Skip to content

Commit 8315679

Browse files
committed
doc(core,jetstream): jsdoc for fields that are in nanoseconds, but where not specified in the description - jsdoc erases the typealias and marks as number
fix(services): processing_time was reported in millis instead of nanos
1 parent a519a25 commit 8315679

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

jetstream/jsapi_types.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export interface SubjectTransformConfig {
111111
export interface StreamConsumerLimits {
112112
/**
113113
* The default `inactive_threshold` applied to consumers.
114-
* This value is specified in nanoseconds. Pleause use the `nanos()`
114+
* This value is specified in nanoseconds. Please use the `nanos()`
115115
* function to convert between millis and nanoseconds. Or `millis()`
116116
* to convert a nanosecond value to millis.
117117
*/
@@ -983,11 +983,11 @@ export interface ConsumerUpdateConfig {
983983
*/
984984
"max_batch"?: number;
985985
/**
986-
* The maximum expires value that may be set when doing a pull on a Pull Consumer
986+
* The maximum expires value in nanoseconds that may be set when doing a pull on a Pull Consumer
987987
*/
988988
"max_expires"?: Nanos;
989989
/**
990-
* Duration that instructs the server to clean up ephemeral consumers that are inactive for that long
990+
* Duration in nanoseconds that instructs the server to clean up ephemeral consumers that are inactive for that long
991991
*/
992992
"inactive_threshold"?: Nanos;
993993
/**

nats-base-client/core.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1017,11 +1017,11 @@ export type NamedEndpointStats = {
10171017
*/
10181018
data?: unknown;
10191019
/**
1020-
* Total processing_time for the service
1020+
* Total processing_time for the service in nanoseconds
10211021
*/
10221022
processing_time: Nanos;
10231023
/**
1024-
* Average processing_time is the total processing_time divided by the num_requests
1024+
* Average processing_time, in nanoseconds, is the total processing_time divided by the num_requests
10251025
*/
10261026
average_processing_time: Nanos;
10271027
/**

nats-base-client/service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ class NamedEndpointStatsImpl implements NamedEndpointStats {
664664
const qii = qi as QueuedIteratorImpl<unknown>;
665665
if (qii?.noIterator === false) {
666666
// grab stats in the iterator
667-
this.processing_time = qii.time;
667+
this.processing_time = nanos(qii.time);
668668
this.num_requests = qii.processed;
669669
this.average_processing_time =
670670
this.processing_time > 0 && this.num_requests > 0

0 commit comments

Comments
 (0)