File: sincos

package info (click to toggle)
munin 2.0.76-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,064 kB
  • sloc: perl: 11,684; java: 1,924; sh: 1,632; makefile: 636; javascript: 365; python: 267
file content (26 lines) | stat: -rw-r--r-- 639 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /usr/bin/perl
# Sample plugin that draw a sine & a cos
# - used for spooling debugging

if ($ARGV[0] eq "config") {
        print "graph_title Trigo plugin\n";
        print "graph_vlabel unit\n";
        print "graph_category debug\n";
        print "update_rate 1\n";
        print "graph_data_size custom 1t, 10s for 1y\n";
        print "sin.label Sine\n";
        print "cos.label Cosine\n";

        exit 0;
}


my $epoch = time;

for (my $i = $epoch - 5; $i < $epoch; $i += 1) {
   print "sin.value $i:". sin($i / 3600). "\n";
}

for (my $i = $epoch - 5; $i < $epoch; $i += 1) {
   print "cos.value $i:". cos($i / 3600). "\n";
}