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

server: make the region heartbeat metric units correct #1128

Merged
merged 5 commits into from
Jul 2, 2018

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented Jun 29, 2018

What have you changed? (required)

In TiKV, we use seconds:

let now = SystemTime::now();
let ts = now.duration_since(UNIX_EPOCH).unwrap().as_secs();
req.set_timestamp(ts);

But in PD, we use milliseconds:

regionHeartbeatLatency.WithLabelValues(storeLabel).Observe(float64(time.Now().UnixNano()/int64(time.Millisecond)) - float64(request.GetTimestamp()))

So the heartbeat latency is wrong now.let the unit correct.

What are the type of the changes (required)?

  • Bug fix (non-breaking change which fixes an issue)

Refer to a related PR or issue link (optional)

#1121

@disksing
Copy link
Contributor

disksing commented Jul 2, 2018

Need to update the metric bucket too. Also the tidb-ansible grafana template need to update too.

@disksing
Copy link
Contributor

disksing commented Jul 2, 2018

LGTM. PTAL @Connor1996

@Connor1996
Copy link
Member

Is unit of second enough to distinguish latency?

@nolouch
Copy link
Contributor Author

nolouch commented Jul 2, 2018

@Connor1996 we only need to know if the heartbeat latency is increasing, that to judge handle the heartbeat become slower.

Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

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

LGTM

@disksing disksing merged commit d4a5a1b into tikv:master Jul 2, 2018
@disksing disksing added the needs-cherry-pick-release-2.0 The PR needs to cherry pick to release-2.0 branch. label Aug 2, 2018
nolouch added a commit to nolouch/pd that referenced this pull request Aug 15, 2018
* server: make the region heartbeat metric units correct

* address comment
@disksing disksing removed the needs-cherry-pick-release-2.0 The PR needs to cherry pick to release-2.0 branch. label Nov 14, 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.

3 participants