count httpd clients
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 5 Oct 2009 12:00:35 +0000 (12:00 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 5 Oct 2009 12:00:35 +0000 (12:00 +0000)
couchdb/httpd/views/ip-count/map.js [new file with mode: 0644]
couchdb/httpd/views/ip-count/reduce.js [new file with mode: 0644]

diff --git a/couchdb/httpd/views/ip-count/map.js b/couchdb/httpd/views/ip-count/map.js
new file mode 100644 (file)
index 0000000..040ff04
--- /dev/null
@@ -0,0 +1,4 @@
+function(doc) {
+  if ( doc.package.name == 'httpd' )
+  emit(doc.peerhost, 1);
+}
\ No newline at end of file
diff --git a/couchdb/httpd/views/ip-count/reduce.js b/couchdb/httpd/views/ip-count/reduce.js
new file mode 100644 (file)
index 0000000..082faf9
--- /dev/null
@@ -0,0 +1,3 @@
+function(k,v) {
+  return sum(v);
+}
\ No newline at end of file