當前位置: 首頁>>代碼示例>>PHP>>正文


PHP rrd::tick方法代碼示例

本文整理匯總了PHP中rrd::tick方法的典型用法代碼示例。如果您正苦於以下問題:PHP rrd::tick方法的具體用法?PHP rrd::tick怎麽用?PHP rrd::tick使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rrd的用法示例。


在下文中一共展示了rrd::tick方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ticker

 public static function ticker($vname = FALSE, $warning = FALSE, $critical = FALSE, $fraction = -0.05, $opacity = 'ff', $color_green = '#00ff00', $color_btw = '#ffff00', $color_red = '#ff0000')
 {
     if ($vname === FALSE) {
         throw new Kohana_exception("rrd::" . __FUNCTION__ . "() First Parameter 'vname' is missing");
     }
     if ($warning === FALSE) {
         throw new Kohana_exception("rrd::" . __FUNCTION__ . "() Second Parameter 'warning' is missing");
     }
     if ($critical === FALSE) {
         throw new Kohana_exception("rrd::" . __FUNCTION__ . "() Third Parameter 'critical' is missing");
     }
     $line = "";
     $green_vname = "var" . substr(sha1(rand()), 1, 4);
     $btw_vname = "var" . substr(sha1(rand()), 1, 4);
     $blue_vname = "var" . substr(sha1(rand()), 1, 4);
     $red_vname = "var" . substr(sha1(rand()), 1, 4);
     $green2_vname = "var" . substr(sha1(rand()), 1, 4);
     $line .= "CDEF:" . $green_vname . "=" . $vname . "," . $warning . ",LT," . $vname . ",UNKN,IF ";
     $line .= "CDEF:" . $btw_vname . "=" . $vname . "," . $critical . ",LT," . $vname . ",UNKN,IF ";
     $line .= "CDEF:" . $blue_vname . "=" . $btw_vname . "," . $warning . ",GE," . $btw_vname . ",UNKN,IF ";
     $line .= "CDEF:" . $red_vname . "=" . $vname . "," . $critical . ",GE," . $vname . ",UNKN,IF ";
     $line .= "CDEF:" . $green2_vname . "=" . $green_vname . ",0,EQ,0.000001," . $green_vname . ",IF ";
     $line .= rrd::tick($green2_vname, $color_green . $opacity, $fraction);
     $line .= rrd::tick($blue_vname, $color_btw . $opacity, $fraction);
     $line .= rrd::tick($red_vname, $color_red . $opacity, $fraction);
     return $line;
 }
開發者ID:rbarraud,項目名稱:pnp4nagios,代碼行數:27,代碼來源:rrd.php

示例2: ticker

 public static function ticker($vname = FALSE, $warning = FALSE, $critical = FALSE, $fraction = -0.05, $opacity = 'ff', $color_green = '#00ff00', $color_btw = '#ffff00', $color_red = '#ff0000')
 {
     if ($vname === FALSE) {
         throw new Kohana_exception("rrd::" . __FUNCTION__ . "() First Parameter 'vname' is missing");
     }
     if ($warning === FALSE) {
         throw new Kohana_exception("rrd::" . __FUNCTION__ . "() Second Parameter 'warning' is missing");
     }
     if ($critical === FALSE) {
         throw new Kohana_exception("rrd::" . __FUNCTION__ . "() Third Parameter 'critical' is missing");
     }
     $line = "";
     $line .= "CDEF:green=" . $vname . "," . $warning . ",LT," . $vname . ",UNKN,IF ";
     $line .= "CDEF:btw=" . $vname . "," . $critical . ",LT," . $vname . ",UNKN,IF ";
     $line .= "CDEF:blue=btw," . $warning . ",GE,btw,UNKN,IF ";
     $line .= "CDEF:red=" . $vname . "," . $critical . ",GE," . $vname . ",UNKN,IF ";
     $line .= "CDEF:green2=green,0,EQ,0.000001,green,IF ";
     $line .= rrd::tick("green2", $color_green . $opacity, $fraction);
     $line .= rrd::tick("blue", $color_btw . $opacity, $fraction);
     $line .= rrd::tick("red", $color_red . $opacity, $fraction);
     return $line;
 }
開發者ID:haraldj,項目名稱:pnp4nagios,代碼行數:22,代碼來源:rrd.php


注:本文中的rrd::tick方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。