Hi guys,
I have one question. I am currently 'translating' your GUI to a PHP one. I have made a lot of progress, but I am wondering about this one.
I am 'using' a slightly modified OpenVZ.pm perl code to query a status of single VPS machine. So, I have changed it not to loop through all available VPS's on the machine, but to accept parameter like "101.conf" and do the magic only for that one. This works like a charm.
However, I do have one question regarding following bit of a Perl code:
Question is:
What should openvz --cpus do (that it doesn't do?)
And, more important - what does relcpu stand for? I really couldn't make it out from the code itself?
I must admit, my Perl knowledge is next to none
Cheers,
Aleks
I have one question. I am currently 'translating' your GUI to a PHP one. I have made a lot of progress, but I am wondering about this one.
I am 'using' a slightly modified OpenVZ.pm perl code to query a status of single VPS machine. So, I have changed it not to loop through all available VPS's on the machine, but to accept parameter like "101.conf" and do the magic only for that one. This works like a charm.
However, I do have one question regarding following bit of a Perl code:
Code:
if ($diff > 1000) { # don't update too often
my $useddiff = $used - $last_proc_vestat->{$veid}->{used};
my $pctcpu = int ($useddiff*100/$diff);
$last_proc_vestat->{$veid}->{sum} = $sum;
$last_proc_vestat->{$veid}->{used} = $used;
$last_proc_vestat->{$veid}->{pctcpu} = $d->{pctcpu} = $pctcpu;
# fixme: openvz --cpus does not work currently
my $relcpu = $pctcpu;
$last_proc_vestat->{$veid}->{relcpu} = $d->{relcpu} = $relcpu;
} else {
$d->{pctcpu} = $last_proc_vestat->{$veid}->{pctcpu};
$d->{relcpu} = $last_proc_vestat->{$veid}->{relcpu};
}
Question is:
What should openvz --cpus do (that it doesn't do?)
And, more important - what does relcpu stand for? I really couldn't make it out from the code itself?
I must admit, my Perl knowledge is next to none
Cheers,
Aleks