Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
chore: change metric key to lower case
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Jan 23, 2018
1 parent 9116da5 commit 559a37e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/metrics/src/metrics/os/TcpGaugeSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ const NetworkTraffic = [
'TCP_OUT_RSTS', // outgoing segments with resets
];

const NetworkTrafficText = {
TCP_ACTIVE_OPENS: 'tcp.active.opens',
TCP_PASSIVE_OPENS: 'tcp.passive.opens',
TCP_ATTEMPT_FAILS: 'tcp.attempt.fails',
TCP_ESTAB_RESETS: 'tcp.estab.resets',
TCP_CURR_RESETS: 'tcp.curr.resets',
TCP_IN_SEGS: 'tcp.in.segs',
TCP_OUT_SEGS: 'tcp.out.segs',
TCP_RETRAN_SEGS: 'tcp.retran.segs',
TCP_IN_ERRS: 'tcp.in.errs',
TCP_OUT_RSTS: 'tcp.out.rsts'
};

export class NetworkTrafficGaugeSet extends CachedMetricSet {

static DEFAULT_FILE_PATH = '/proc/net/snmp';
Expand All @@ -40,7 +53,7 @@ export class NetworkTrafficGaugeSet extends CachedMetricSet {

for (let key of NetworkTraffic) {
gauges.push({
name: MetricName.build(key),
name: MetricName.build(NetworkTrafficText[key]),
metric: <Gauge<number>> {
getValue() {
self.refreshIfNecessary();
Expand Down

0 comments on commit 559a37e

Please sign in to comment.