GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
BSD::devstat(3) User Contributed Perl Documentation BSD::devstat(3)

BSD::devstat - interface to devstat(3) API

  use BSD::devstat;

  my $ds = BSD::devstat->new();
  printf "Number of devices: %d\n", $ds->numdevs;

  my $devidx = $ds->numdevs;    # this is last device.

  my $dev = $ds->devices($devidx);
  printf "%s%d block_size=%d\n", $dev->{device_name},
    $dev->{unit_number}, $dev->{block_size};

  # Stat in 2 seconds.
  my $stat = $ds->compute_statistics($devidx, 2.0);
  printf "BUSY_PCT=%.2f\n", $stat->{BUSY_PCT};

BSD::devstat is interface to devstat(3) API. You can grab device statistics information which is provided by devstat(9) kernel interface via devstat(3) userland interface.
new()
Retrieve device statistics and store it as BSD::devstat object.
numdevs()
Return the number of devices which devstat(3) API provided.
devices($device_index)
$device_index is index for device, which can be from 0 to ($self->numdevs() - 1). Returns hash reference. This contains various values described in devstat(9) manpage. This method will croak if error occured.
compute_statistics($device_index, $elapse_time)
$device_index is index for device, which can be from 0 to ($self->numdevs() - 1). $elapse_time is second (can be float number) between two snapshots of statistics and calculation by done with these statistics. Returns hash reference. This contains various values described at devstat_compute_statistics() function in devstat(3) manpage. This method will croak if error occured.

Jun Kuriyama <kuriyama@FreeBSD.org>

devstat(3), devstat(9).

Currently supports only FreeBSD.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2010-04-01 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.