Skip to content
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

remove formatting from ResettingTimer metrics if requested in raw format #17092

Merged
merged 1 commit into from
Jul 2, 2018
Merged

remove formatting from ResettingTimer metrics if requested in raw format #17092

merged 1 commit into from
Jul 2, 2018

Conversation

gravityblast
Copy link
Contributor

metrics.ResettingTimer are always formatted as strings even when debug_metrics is called passing true, which is used to get raw metrics.
In this PR I removed the formatting of metrics.ResettingTimer metrics if raw is true.

here an example, we can look at trie.memcache.flush.time metrics, that have the final s:

> debug.metrics(true).trie.memcache.flush
{
  nodes: {
    AvgRate01Min: 0,
    AvgRate05Min: 0,
    AvgRate15Min: 0,
    MeanRate: 0,
    Overall: 0
  },
  size: {
    AvgRate01Min: 0,
    AvgRate05Min: 0,
    AvgRate15Min: 0,
    MeanRate: 0,
    Overall: 0
  },
  time: {
    Mean: "0s",
    Measurements: 0,
    Percentiles: {
      20: "0s",
      5: "0s",
      50: "0s",
      80: "0s",
      95: "0s"
    }
  }
}

on this branch:

> debug.metrics(true).trie.memcache.flush
{
  nodes: {
    AvgRate01Min: 0,
    AvgRate05Min: 0,
    AvgRate15Min: 0,
    MeanRate: 0,
    Overall: 0
  },
  size: {
    AvgRate01Min: 0,
    AvgRate05Min: 0,
    AvgRate15Min: 0,
    MeanRate: 0,
    Overall: 0
  },
  time: {
    Mean: 0,
    Measurements: 0,
    Percentiles: {
      20: 0,
      5: 0,
      50: 0,
      80: 0,
      95: 0
    }
  }
}

Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for this!

@karalabe karalabe added this to the 1.8.12 milestone Jul 2, 2018
@karalabe karalabe merged commit 8974e2e into ethereum:master Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants