当前位置: 首页>>代码示例>>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;未经允许,请勿转载。