当前位置: 首页>>代码示例>>PHP>>正文


PHP Dashboard::addRow方法代码示例

本文整理汇总了PHP中Dashboard::addRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Dashboard::addRow方法的具体用法?PHP Dashboard::addRow怎么用?PHP Dashboard::addRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dashboard的用法示例。


在下文中一共展示了Dashboard::addRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: errorMarkdownDashboard

 /**
     Creates a new Markdown dashboard.
     @param string $message contains the body.
     @return object
     **/
 public static function errorMarkdownDashboard($message)
 {
     $dashboard = new Dashboard('Error');
     $dashboard->addRow(static::genMarkdownRow($message, 'ERROR'));
     return $dashboard;
 }
开发者ID:simonmeggle,项目名称:histou,代码行数:11,代码来源:debug.php

示例2: Rule

/**
Load Check Template File.
PHP version 5
@category Template_File
@package Histou/templates/default
@author Philip Griesbacher <griesbacher@consol.de>
@license http://opensource.org/licenses/gpl-license.php GNU Public License
@link https://github.com/Griesbacher/histou
**/
$rule = new Rule($host = '*', $service = '*', $command = '*', $perfLabel = array('load1', 'load5', 'load15'));
$genTemplate = function ($perfData) {
    $perfKeys = array_keys($perfData['perfLabel']);
    $dashboard = new Dashboard($perfData['host'] . '-' . $perfData['service']);
    $row = new Row($perfData['service'] . ' ' . $perfData['command']);
    $panel = new GraphPanel($perfData['host'] . ' ' . $perfData['service'] . ' ' . $perfData['command']);
    $colors = array('#085DFF', '#07ff78', '#4707ff');
    for ($i = 0; $i < sizeof($perfData['perfLabel']); $i++) {
        $target = sprintf('%s%s%s%s%s%s%s%s%s', $perfData['host'], INFLUX_FIELDSEPERATOR, $perfData['service'], INFLUX_FIELDSEPERATOR, $perfData['command'], INFLUX_FIELDSEPERATOR, $perfKeys[$i], INFLUX_FIELDSEPERATOR, "value");
        $alias = $perfKeys[$i];
        $panel->addAliasColor($alias, $colors[$i]);
        $panel->addTargetSimple($target, $alias);
        $panel->fillBelowLine($alias, 2);
        $panel->addDowntime($perfData['host'], $perfData['service'], $perfData['command'], $perfKeys[$i]);
    }
    $panel->addWarning($perfData['host'], $perfData['service'], $perfData['command'], $perfKeys['load1']);
    $panel->addCritical($perfData['host'], $perfData['service'], $perfData['command'], $perfKeys['load1']);
    $row->addPanel($panel);
    $dashboard->addRow($row);
    $dashboard->addDefaultAnnotations($perfData['host'], $perfData['service']);
    return $dashboard;
};
开发者ID:simonmeggle,项目名称:histou,代码行数:31,代码来源:load.php


注:本文中的Dashboard::addRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。