Conversation
My initial feedback is that this doesn't follow the pattern of keeping dependencies out of the See gcnotify as an example. I don't have a strong opinion about this, but we did a lot of work to clean up the |
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.
sorry, left my feedback in the wrong place. See my comment on the main thread of this PR regarding dependency injection.
3357b3f
to
724398b
Compare
revised to use the existing |
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.
I'm confused about how cores
is determined.
On my mac, I get this for infos
:
([]cpu.InfoStat) (len=1 cap=1) {
(cpu.InfoStat) {"cpu":0,"vendorId":"GenuineIntel","family":"6","model":"61","stepping":4,"physicalId":"","coreId":"","cores":2,"modelName":"Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz","mhz":2900,"cacheSize":256,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clfsh","ds","acpi","mmx","fxsr","sse","sse2","ss","htt","tm","pbe","sse3","pclmulqdq","dtes64","mon","dscpl","vmx","est","tm2","ssse3","fma","cx16","tpr","pdcm","sse4.1","sse4.2","x2apic","movbe","popcnt","aes","pcid","xsave","osxsave","seglim64","tsctmr","avx1.0","rdrand","f16c","smep","erms","rdwrfsgs","tsc_thread_offset","bmi1","avx2","bmi2","invpcid","smap","rdseed","adx","ipt","fpu_csds","syscall","xd","1gbpage","em64t","lahf","lzcnt","prefetchw","rdtscp","tsci"],"microcode":""}
}
which seems to indicate that I have 2 cores.
But /info
returns:
{
"shardWidth": 1048576,
"memory": 17179869184,
"cpuType": "Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz",
"CPUPhysicalCores": 1,
"CPULogicalCores": 1,
"CPUMHz": 2900
}
724398b
to
83322b3
Compare
Hah. And I added the json field names... and that broke the test, which I apparently didn't rerun. |
83322b3
to
449a181
Compare
it looks like that CI failure was just the ongoing occasional races in memberlist. |
should we try to get this merged? needs a rebase |
I think so. It's useful, and imagine uses it if it's available. |
the patch applied cleanly to master, so let's see whether CI passes! |
'M': 1, | ||
'G': 1000, | ||
'T': 1000 * 1000, | ||
} |
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.
I did not know you could do this... not sure how I feel about it.
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 two syntactic sugar at once. One is that you can use labeled initializers in slice/array constants, just like in struct ones, the other is that you can treat runes as their unicode values.
Very convenient, though.
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.
approved, but... needs another rebase :)
Travis' issue seems to be fixed. At least... my mac reports correct numbers and ours our about the same age. |
report the approximate hardware specs (CPU speed, cores, memory) of the server in the /info endpoint. This may be useful when benchmarking. We do some workarounds because gopsutil's core count output is confusingly different between Linux and Darwin, and the MHz output is usually wrong on Linux. Intel's app notes say to just parse the model string. Whyyyyyyy.
report the approximate hardware specs (CPU speed, cores, memory)
of the server in the /info endpoint. This may be useful when
benchmarking.
Fixes #651
(note: docs haven't been changed, and maybe they should, but right now we don't actually document /info at all, apparently?)
Pull request checklist
Code review checklist
This is the checklist that the reviewer will follow while reviewing your pull request. You do not need to do anything with this checklist, but be aware of what the reviewer will be looking for.