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

fix issue that metric db_compaction_total_duration_milliseconds is always 0 #10646

Merged
merged 1 commit into from
Apr 20, 2019

Conversation

yingnanzhang666
Copy link
Contributor

defer dbCompactionTotalMs.Observe(float64(time.Since(totalStart) / time.Millisecond))
Here, it will calculate float64(time.Since(totalStart) / time.Millisecond) when call defer directly and push into function stack, so the duration is quite small, less than 1 millisecond, so this value is always zero.

# HELP etcd_debugging_mvcc_db_compaction_total_duration_milliseconds Bucketed histogram of db compaction total duration.
# TYPE etcd_debugging_mvcc_db_compaction_total_duration_milliseconds histogram
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="100"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="200"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="400"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="800"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="1600"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="3200"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="6400"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="12800"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="25600"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="51200"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="102400"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="204800"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="409600"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="819200"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket{le="+Inf"} 3564
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_sum 0
etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_count 3564

@jingyih
Copy link
Contributor

jingyih commented Apr 15, 2019

Thanks for the fix!

Can you change the title of the commit to <package>: <title>? In this case, it is something like mvcc: fix db_compaction_total_duration_milliseconds.

@yingnanzhang666
Copy link
Contributor Author

@jingyih commit title is changed as your recommendation. thx.

@jingyih
Copy link
Contributor

jingyih commented Apr 16, 2019

lgtm

@jingyih
Copy link
Contributor

jingyih commented Apr 16, 2019

We should probably backport this. @jpbetz

@jpbetz
Copy link
Contributor

jpbetz commented Apr 17, 2019

jpbetz added a commit to jpbetz/etcd that referenced this pull request Apr 18, 2019
jpbetz added a commit that referenced this pull request Apr 18, 2019
jpbetz added a commit that referenced this pull request Apr 18, 2019
jpbetz added a commit that referenced this pull request Apr 18, 2019
jpbetz added a commit that referenced this pull request Apr 18, 2019
CHANGELOG: update changelogs for backport of PR #10646
@jingyih jingyih merged commit 943d688 into etcd-io:master Apr 20, 2019
jingyih added a commit to jingyih/etcd that referenced this pull request Apr 20, 2019
gyuho added a commit that referenced this pull request Apr 23, 2019
MartinWeindel pushed a commit to MartinWeindel/etcd that referenced this pull request Jun 12, 2019
MartinWeindel pushed a commit to MartinWeindel/etcd that referenced this pull request Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants