system.cpu Metrics from DataDog Agent

Name

  • system.cpu.guest
  • Percent (Unit)
  • The percent of time the CPU spent running the virtual processor. Only applies to hypervisors.
  • system.cpu.idle
  • Percent (Unit)
  • Percent of time the CPU spent in an idle state.
  • system.cpu.iowait
  • Percent (Unit)
  • The percent of time the CPU spent waiting for IO operations to complete.
  • system.cpu.stolen
  • Percent (Unit)
  • The percent of time the virtual CPU spent waiting for the hypervisor to service another virtual CPU. Only applies to virtual machines.
  • system.cpu.system
  • Percent (Unit)
  • The percent of time the CPU spent running the kernel.
  • system.cpu.user
  • Percent (Unit)
  • The percent of time the CPU spent running user space processes.

計(jì)算公式

system.cpu.guest = %guest
system.cpu.idle = %idle
system.cpu.iowait = %iowait
system.cpu.stolen = %steal
system.cpu.system = %sys + %irq + %soft
system.cpu.user = %usr + %user + %nice

數(shù)據(jù)來(lái)源

針對(duì)Linux系統(tǒng)皆警,DataDog Agent使用mpstat實(shí)時(shí)監(jiān)控工具奈懒,獲取CPU相關(guān)的Metrics。DataDog Agent并沒(méi)有獲取各個(gè)CPU的詳細(xì)信息白群,而是所有CPU的平均值。

mpstat是Multiprocessor Statistics的縮寫(xiě),是實(shí)時(shí)系統(tǒng)CPU監(jiān)控工具。監(jiān)控信息來(lái)自內(nèi)核文件:/proc/stat

mpstat輸出內(nèi)容示例

# mpstat 1 3

Linux 3.10.0-693.21.1.el7.x86_64 (ip-172-31-22-228.cn-north-1.compute.internal)     08/29/2018  _x86_64_    (8 CPU)

05:59:14 AM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
05:59:15 AM  all    8.06    0.13    7.15    0.00    0.00    0.78    0.13    0.00    0.00   83.75
05:59:16 AM  all   14.61    0.00    8.16    0.00    0.00    1.05    0.26    0.00    0.00   75.92
05:59:17 AM  all   18.69    0.13    5.75    0.00    0.00    0.78    0.13    0.00    0.00   74.51
Average:     all   13.78    0.09    7.02    0.00    0.00    0.87    0.17    0.00    0.00   78.07

各個(gè)字段含義如下(internal時(shí)間段內(nèi)的平均值)

CPU       Processor number. The keyword all indicates that statistics are calculated as averages among all processors.
%usr      Show the percentage of CPU utilization that occurred while executing at the user level (application).
%nice     Show the percentage of CPU utilization that occurred while executing at the user level with nice priority.
%sys      Show  the  percentage  of  CPU utilization that occurred while executing at the system level (kernel). Note that this does not include time spent servicing hardware and software interrupts.
%iowait   Show the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.
%irq      Show the percentage of time spent by the CPU or CPUs to service hardware interrupts.
%soft     Show the percentage of time spent by the CPU or CPUs to service software interrupts.
%steal    Show  the  percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.
%guest    Show the percentage of time spent by the CPU or CPUs to run a virtual processor.
%gnice    Show the percentage of time spent by the CPU or CPUs to run a niced guest.
%idle     Show the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末党涕,一起剝皮案震驚了整個(gè)濱河市烦感,隨后出現(xiàn)的幾起案子巡社,更是在濱河造成了極大的恐慌,老刑警劉巖手趣,帶你破解...
    沈念sama閱讀 223,126評(píng)論 6 520
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件晌该,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡绿渣,警方通過(guò)查閱死者的電腦和手機(jī)朝群,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 95,421評(píng)論 3 400
  • 文/潘曉璐 我一進(jìn)店門(mén),熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)中符,“玉大人姜胖,你說(shuō)我怎么就攤上這事〉砩ⅲ” “怎么了右莱?”我有些...
    開(kāi)封第一講書(shū)人閱讀 169,941評(píng)論 0 366
  • 文/不壞的土叔 我叫張陵蚜锨,是天一觀的道長(zhǎng)。 經(jīng)常有香客問(wèn)我慢蜓,道長(zhǎng)亚再,這世上最難降的妖魔是什么? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 60,294評(píng)論 1 300
  • 正文 為了忘掉前任晨抡,我火速辦了婚禮氛悬,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘耘柱。我一直安慰自己如捅,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 69,295評(píng)論 6 398
  • 文/花漫 我一把揭開(kāi)白布帆谍。 她就那樣靜靜地躺著伪朽,像睡著了一般。 火紅的嫁衣襯著肌膚如雪汛蝙。 梳的紋絲不亂的頭發(fā)上烈涮,一...
    開(kāi)封第一講書(shū)人閱讀 52,874評(píng)論 1 314
  • 那天,我揣著相機(jī)與錄音窖剑,去河邊找鬼坚洽。 笑死,一個(gè)胖子當(dāng)著我的面吹牛西土,可吹牛的內(nèi)容都是我干的讶舰。 我是一名探鬼主播,決...
    沈念sama閱讀 41,285評(píng)論 3 424
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼需了,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼跳昼!你這毒婦竟也來(lái)了?” 一聲冷哼從身側(cè)響起肋乍,我...
    開(kāi)封第一講書(shū)人閱讀 40,249評(píng)論 0 277
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤鹅颊,失蹤者是張志新(化名)和其女友劉穎,沒(méi)想到半個(gè)月后墓造,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體堪伍,經(jīng)...
    沈念sama閱讀 46,760評(píng)論 1 321
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,840評(píng)論 3 343
  • 正文 我和宋清朗相戀三年觅闽,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了帝雇。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 40,973評(píng)論 1 354
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡蛉拙,死狀恐怖尸闸,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤吮廉,帶...
    沈念sama閱讀 36,631評(píng)論 5 351
  • 正文 年R本政府宣布睹栖,位于F島的核電站,受9級(jí)特大地震影響茧痕,放射性物質(zhì)發(fā)生泄漏野来。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 42,315評(píng)論 3 336
  • 文/蒙蒙 一踪旷、第九天 我趴在偏房一處隱蔽的房頂上張望曼氛。 院中可真熱鬧,春花似錦令野、人聲如沸舀患。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 32,797評(píng)論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)聊浅。三九已至,卻和暖如春现使,著一層夾襖步出監(jiān)牢的瞬間低匙,已是汗流浹背。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 33,926評(píng)論 1 275
  • 我被黑心中介騙來(lái)泰國(guó)打工碳锈, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留顽冶,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 49,431評(píng)論 3 379
  • 正文 我出身青樓售碳,卻偏偏與公主長(zhǎng)得像强重,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子贸人,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,982評(píng)論 2 361

推薦閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,352評(píng)論 0 10
  • 準(zhǔn)備间景,出方案 學(xué)習(xí)間隙的練習(xí) 操前集體讀書(shū) 統(tǒng)一的白鞋 整齊的步伐 滿臉的朝氣
    子非魚(yú)lily閱讀 574評(píng)論 0 0
  • 作者:席慕蓉 所有的結(jié)局都已寫(xiě)好 所有的淚水也都已啟程 卻忽然忘了是怎么樣的一個(gè)開(kāi)始 在那個(gè)古老的不再回來(lái)的夏日 ...
    洞房花豬閱讀 143評(píng)論 0 0
  • 整個(gè)學(xué)期都處在忙完這陣忙下陣的狀態(tài)倘要,到了考試月,反倒無(wú)事可做了力惯。又不想看書(shū)碗誉,索性就回味一下舊事召嘶。 在端午來(lái)臨之際結(jié)...
    Miku冬至閱讀 554評(píng)論 0 6
  • 當(dāng)我 還是個(gè)小孩子 那些單純的日子 卻離我越來(lái)越遠(yuǎn) 孤獨(dú) 忍藏在卑微里的花蕊里 卻又為何只爭(zhēng)朝夕的開(kāi)放著 那些迎著...
    常吉清才閱讀 672評(píng)論 0 0