docs for state class
Robert 'phaylon' Sedlacek [Mon, 28 May 2012 21:44:16 +0000 (21:44 +0000)]
lib/System/Introspector/State.pm

index fae866e..064006a 100644 (file)
@@ -88,3 +88,58 @@ sub _create_gatherer {
 }
 
 1;
+
+=head1 NAME
+
+System::Introspector::State - Gather system state
+
+=head1 SYNOPSIS
+
+    my $state = System::Introspector::State->new(
+        host    => 'foo.example.com',
+        storage => $storage_obj,
+        config  => {
+            introspect => [qw( ProbeName )],
+        },
+    );
+
+    my $data = $state->fetch;
+    $state->fetch_and_store;
+
+=head1 DESCRIPTION
+
+Gathers system introspection data based on configuration and stores
+it with a L<File::Tree::Snapshot> object.
+
+=head1 ATTRIBUTES
+
+=head2 config
+
+A hash reference containing a C<introspect> key with an array reference
+value containing a list of probe names without the
+C<System::Introspector::Probe::> prefix. This attribute is required.
+
+=head2 host
+
+An optional hostname. If no hostname is supplied, the local configuration
+data will be fetched.
+
+=head2 storage
+
+A L<File::Tree::Snapshot> object.
+
+=head1 METHODS
+
+=head2 fetch
+
+    my $data = $state->fetch;
+
+Fetches all probe data.
+
+=head2 fetch_and_store
+
+    $state->fetch_and_store;
+
+Fetches all probe data and stores it in the L</storage>.
+
+=cut