From 827c631499150d80526ef6e90b6d29d96bbe586e Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 5 Oct 2009 12:00:35 +0000 Subject: [PATCH] count httpd clients --- couchdb/httpd/views/ip-count/map.js | 4 ++++ couchdb/httpd/views/ip-count/reduce.js | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 couchdb/httpd/views/ip-count/map.js create mode 100644 couchdb/httpd/views/ip-count/reduce.js diff --git a/couchdb/httpd/views/ip-count/map.js b/couchdb/httpd/views/ip-count/map.js new file mode 100644 index 0000000..040ff04 --- /dev/null +++ b/couchdb/httpd/views/ip-count/map.js @@ -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 index 0000000..082faf9 --- /dev/null +++ b/couchdb/httpd/views/ip-count/reduce.js @@ -0,0 +1,3 @@ +function(k,v) { + return sum(v); +} \ No newline at end of file -- 2.20.1