?? nodequery.xpl
字號(hào):
<?xml version="1.0"?><!DOCTYPE methoddef SYSTEM "rpc-method.dtd"><methoddef><name>NodeQuery</name><version>1.0</version><signature>struct scalar</signature><help> Accepts a scalar containing: transp scalar one of 'drw' char, as a transport codeReturns a struct containing KEY VALUE ret_code int (numeric return code) ret_val string (message string) Health int (health value 0-100) CpuLoad int (cpu load value 0-100) Throughput int (total streaming server throughput in bit/s)</help><code language="perl"><![CDATA[#!/usr/bin/perl################################################################################ Sub Name: NodeQuery## Accepts a scalar containing:# transp scalar one of 'drw' char, as a transport code## Returns a struct containing# KEY VALUE# ret_code int (numeric return code)# ret_val string (message string)# Health int (health value 0-100)# CpuLoad int (cpu load value 0-100)# Throughput int (total streaming server throughput in bit/s)###############################################################################sub NodeQuery { use CommLib qw(node_log); my $transp = shift; my $thrp = &Adaptation::query_band($transp); my $cpu = &NodeLib::query_cpu; my $health = (( $maxband - $thrp ) / $maxband) * (( 100 - $cpu ) / 100 ) * 100; my ( $ret_code, $ret_val ); #writes a system log node_log ( ">>> Receiving a node status query. Total throughput is $thrp bit/s. Cpu load is $cpu %. Health is $health.", 3, 'n'); return { ret_code => '200', ret_val => 'Node sending status values correctly', Health => $health, CpuLoad => $cpu, Throughput => $thrp };}__END__]]></code></methoddef>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -