Skip to content

Instantly share code, notes, and snippets.

@WyriHaximus
Created August 31, 2016 16:31
Show Gist options
  • Select an option

  • Save WyriHaximus/db96abb34e059cdfe89c241594d8f3b5 to your computer and use it in GitHub Desktop.

Select an option

Save WyriHaximus/db96abb34e059cdfe89c241594d8f3b5 to your computer and use it in GitHub Desktop.
<?php
$counters = $this->loopInfoProvider->getCounters();
$this->loopInfoProvider->resetTotals();
$this->loopInfoProvider->resetTicks();
foreach ([
'streams.read.current' => $counters['streams']['read']['current'],
'streams.read.total' => $counters['streams']['read']['total'],
'streams.read.ticks' => $counters['streams']['read']['ticks'],
'streams.total.current' => $counters['streams']['total']['current'],
'streams.total.total' => $counters['streams']['total']['total'],
'streams.total.ticks' => $counters['streams']['total']['ticks'],
'streams.write.current' => $counters['streams']['write']['current'],
'streams.write.total' => $counters['streams']['write']['total'],
'streams.write.ticks' => $counters['streams']['write']['ticks'],
'timers.once.current' => $counters['timers']['once']['current'],
'timers.once.total' => $counters['timers']['once']['total'],
'timers.once.ticks' => $counters['timers']['once']['ticks'],
'timers.periodic.current' => $counters['timers']['periodic']['current'],
'timers.periodic.total' => $counters['timers']['periodic']['total'],
'timers.periodic.ticks' => $counters['timers']['periodic']['ticks'],
'ticks.future.current' => $counters['ticks']['future']['current'],
'ticks.future.total' => $counters['ticks']['future']['total'],
'ticks.future.ticks' => $counters['ticks']['future']['ticks'],
'ticks.next.current' => $counters['ticks']['next']['current'],
'ticks.next.total' => $counters['ticks']['next']['total'],
'ticks.next.ticks' => $counters['ticks']['next']['ticks'],
] as $index => $value) {
$channel->publish('net.wyrihaximus.services.overlord.eventloop.' . $index . ' ' . $value . ' ' . time(), [], '', 'graphite')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment