gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r14299 - gauger


From: gnunet
Subject: [GNUnet-SVN] r14299 - gauger
Date: Mon, 31 Jan 2011 16:54:28 +0100

Author: bartpolot
Date: 2011-01-31 16:54:28 +0100 (Mon, 31 Jan 2011)
New Revision: 14299

Modified:
   gauger/README
   gauger/gauger.h
Log:
Changed the main funcion into a macro, extended README


Modified: gauger/README
===================================================================
--- gauger/README       2011-01-31 14:39:17 UTC (rev 14298)
+++ gauger/README       2011-01-31 15:54:28 UTC (rev 14299)
@@ -1,22 +1,56 @@
 Measurment storing and plotting tool
 
+Notes
+=====
+
+This software is written in python v2. If your distribution packages
+python v2 as the default, change the first line of each script:
+
+From: #!/usr/bin/env python2
+To:   #!/usr/bin/env python
+
 Files
 =====
 
  * gauger.conf: Server configuration
   Should contain usernames, passwords and the desired hostname for each
   machine authorized to log data to the server, one per line.
-  lines starting with # are ignored. Example:
+  Should be placed in same directory as gauger.py
+  Lines starting with # are ignored. Example:
   #USER PASS HOSTNAME
   user 123456 foo
   user2 god bar
 
  * gauger-cli.conf: Client configuration
   Should contain one line with the server hostname, user and password.
+  Should be placed in the same directory as gauger-cli.py or in the user's
+  home, as ~/.gauger-cli.conf
   Example:
   server.tld user 123456
 
 
+Usage
+=====
+Before running, make sure the appropiate .conf files are in place
+
+ * Server
+  Run directly in data directory with ./gauger.py > gauger.log
+
+ * Client
+   * Command line
+    invoke with ./gauger-cli.py COUNTER_NAME COUNTER_VALUE
+   * C program
+     * Include "gauger.h"
+     * Call the macro GAUGER("COUNTER_NAME", COUNTER_VALUE)
+     * Example:
+
+        #include "gauger.h"
+
+        int main(int argc, char *argv[]) {
+            GAUGER("counter1", 100)
+            return 0;
+        }
+
 Dependencies
 ============
  
@@ -27,4 +61,4 @@
     web site: http://www.gnuplot.info/
 
  * subversion >= 1.6
-    web site: http://subversion.tigris.org/
\ No newline at end of file
+    web site: http://subversion.tigris.org/

Modified: gauger/gauger.h
===================================================================
--- gauger/gauger.h     2011-01-31 14:39:17 UTC (rev 14298)
+++ gauger/gauger.h     2011-01-31 15:54:28 UTC (rev 14299)
@@ -1,6 +1,10 @@
 #ifndef __GAUGER_H__
 #define __GAUGER_H__
 
-void gauger_log(char *counter, int value);
+#include <unistd.h>
+#include <stdio.h>
+#include <sys/wait.h>
 
-#endif
\ No newline at end of file
+#define GAUGER(counter, value) char __gauger_s[32];pid_t 
__gauger_p;if(!(__gauger_p=fork())){if(!fork()){sprintf(__gauger_s,"%d",value);execlp("gauger-cli.py","gauger-cli.py",counter,
 
__gauger_s,(char*)NULL);perror("gauger");_exit(1);}else{_exit(0);}}else{waitpid(__gauger_p,NULL,0);}
+
+#endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]