當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。