Skip to content

Commit

Permalink
Merge pull request #727 from nats-io/fix-nanos
Browse files Browse the repository at this point in the history
nano fixes
  • Loading branch information
aricart authored Aug 22, 2024
2 parents a519a25 + 8315679 commit 7ba5c6e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions jetstream/jsapi_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export interface SubjectTransformConfig {
export interface StreamConsumerLimits {
/**
* The default `inactive_threshold` applied to consumers.
* This value is specified in nanoseconds. Pleause use the `nanos()`
* This value is specified in nanoseconds. Please use the `nanos()`
* function to convert between millis and nanoseconds. Or `millis()`
* to convert a nanosecond value to millis.
*/
Expand Down Expand Up @@ -983,11 +983,11 @@ export interface ConsumerUpdateConfig {
*/
"max_batch"?: number;
/**
* The maximum expires value that may be set when doing a pull on a Pull Consumer
* The maximum expires value in nanoseconds that may be set when doing a pull on a Pull Consumer
*/
"max_expires"?: Nanos;
/**
* Duration that instructs the server to clean up ephemeral consumers that are inactive for that long
* Duration in nanoseconds that instructs the server to clean up ephemeral consumers that are inactive for that long
*/
"inactive_threshold"?: Nanos;
/**
Expand Down
4 changes: 2 additions & 2 deletions nats-base-client/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1017,11 +1017,11 @@ export type NamedEndpointStats = {
*/
data?: unknown;
/**
* Total processing_time for the service
* Total processing_time for the service in nanoseconds
*/
processing_time: Nanos;
/**
* Average processing_time is the total processing_time divided by the num_requests
* Average processing_time, in nanoseconds, is the total processing_time divided by the num_requests
*/
average_processing_time: Nanos;
/**
Expand Down
2 changes: 1 addition & 1 deletion nats-base-client/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ class NamedEndpointStatsImpl implements NamedEndpointStats {
const qii = qi as QueuedIteratorImpl<unknown>;
if (qii?.noIterator === false) {
// grab stats in the iterator
this.processing_time = qii.time;
this.processing_time = nanos(qii.time);
this.num_requests = qii.processed;
this.average_processing_time =
this.processing_time > 0 && this.num_requests > 0
Expand Down

0 comments on commit 7ba5c6e

Please sign in to comment.