-
Notifications
You must be signed in to change notification settings - Fork 401
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
How to add a new Indicator? #504
Comments
Better on php collector with var debugbar = new PhpDebugBar.DebugBar();
debugbar.createIndicator('dbhost_ind', 'cogs', 'connected db', 'right');
debugbar.setDataMap({
'dbhost_ind': ['dbhost.duration_str', '0ms']
});
// Example adding dataset manually
debugbar.addDataSet({
'dbhost': {'duration_str': '10ms'}
}); Your php colector must return class DbHostCollector extends DataCollector /*implements Renderable*/
{
/**
* @return string
*/
public function getName()
{
return 'dbhost';
}
/**
* @return array
*/
public function collect()
{
return array(
'duration_str' => '10ms'
);
}
// with Renderable `setDataMap` and `createIndicator` are not needed
/*public function getWidgets()
{
return array(
"dbhost_ind" => array(
"icon" => "cogs",
"tooltip" => "connected db",
"map" => "dbhost.duration_str",
"default" => "0ms"
),
);
}*/
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've read the docs, but in my project what happens is, that the following code just adds an additional DebugBar:
But of course I want to add the indicator to the existing bar.
What am I missing?
The text was updated successfully, but these errors were encountered: