Skip to content

Commit

Permalink
[CHANGE] [SRV] [BREAKING] removed NamedEndpointStats#metadata refer…
Browse files Browse the repository at this point in the history
…ence, reference `EndpointInfo#metadata` instead
  • Loading branch information
aricart committed May 31, 2023
1 parent 53843ce commit 05eb6cd
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 13 deletions.
4 changes: 0 additions & 4 deletions nats-base-client/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,10 +926,6 @@ export type NamedEndpointStats = {
* Average processing_time is the total processing_time divided by the num_requests
*/
average_processing_time: Nanos;
/**
* Endpoint Metadata
*/
metadata?: Record<string, string>;
};
/**
* Statistics for an endpoint
Expand Down
3 changes: 0 additions & 3 deletions nats-base-client/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ export class ServiceImpl implements Service {
this.internal.push(sv);
}
sv.stats = new NamedEndpointStatsImpl(name, subject);
sv.stats.metadata = h.metadata;

const callback = handler
? (err: NatsError | null, msg: Msg) => {
Expand Down Expand Up @@ -630,7 +629,6 @@ class NamedEndpointStatsImpl implements NamedEndpointStats {
processing_time,
last_error,
data,
metadata,
} = this;
return {
name,
Expand All @@ -641,7 +639,6 @@ class NamedEndpointStatsImpl implements NamedEndpointStats {
processing_time,
last_error,
data,
metadata,
};
}

Expand Down
5 changes: 0 additions & 5 deletions tests/helpers/service-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,6 @@ const statsSchema: JSONSchemaType<ServiceStats> = {
processing_time: { type: "number" },
average_processing_time: { type: "number" },
data: { type: "string" },
metadata: {
type: "object",
minProperties: 1,
},
},
required: [
"num_requests",
Expand All @@ -284,7 +280,6 @@ const statsSchema: JSONSchemaType<ServiceStats> = {
"processing_time",
"average_processing_time",
"data",
"metadata",
],
},
},
Expand Down
1 change: 0 additions & 1 deletion tests/service_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,6 @@ Deno.test("service - metadata", async () => {
assertEquals(info.metadata, { service: "1" });
const stats = await srv.stats();
assertEquals(stats.endpoints?.length, 1);
assertEquals(stats.endpoints?.[0].metadata, { endpoint: "endpoint" });

await cleanup(ns, nc);
});
Expand Down

0 comments on commit 05eb6cd

Please sign in to comment.