-
Notifications
You must be signed in to change notification settings - Fork 780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(server): add getTunneltime to manager metrics #1581
base: master
Are you sure you want to change the base?
feat(server): add getTunneltime to manager metrics #1581
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. This is exactly the kind of discussion I was looking for!
40975be
to
cf4383b
Compare
@@ -40,4 +58,21 @@ export class PrometheusManagerMetrics implements ManagerMetrics { | |||
} | |||
return {bytesTransferredByUserId: usage}; | |||
} | |||
|
|||
async getTunnelTimeByLocation({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer by location. It's broken down by all dimensions. Please rename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The metric name is shadowsocks_tunnel_time_seconds_per_location
as opposed to the shadowsocks_tunnel_time_seconds
metric - does that matter to you?
export type TunnelTimeDimension = 'access_key' | 'country' | 'asn'; | ||
|
||
interface TunnelTimeRequest { | ||
time_window: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's define a Duration type and reuse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean like...
interface Duration {
hours?: number;
seconds?: number;
}
What happens if both hours
and seconds
are there?
@@ -599,6 +601,23 @@ export class ShadowsocksManagerService { | |||
} | |||
} | |||
|
|||
async getTunnelTimeByLocation(req: RequestType, res: ResponseType, next: restify.Next) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename
successful result from digital ocean droplet:
TODOs: