stream-log-stats
Advanced tools
Comparing version 0.0.0 to 0.0.1
"use strict"; | ||
var o = require("object-ting"), | ||
path = require("path"); | ||
path = require("path"), | ||
byteSize = require("byte-size"); | ||
@@ -8,3 +9,4 @@ var stats = module.exports = { | ||
clientCount: 0, | ||
transferred: 0, | ||
bytes: 0, | ||
transferred: "0", | ||
requests: 0, | ||
@@ -61,1 +63,5 @@ resource: {}, | ||
}; | ||
stats.addBytes = function(bytes){ | ||
this.bytes += bytes; | ||
this.transferred = byteSize(this.bytes, 2); | ||
}; |
@@ -23,3 +23,3 @@ "use strict"; | ||
var logObject = JSON.parse(json); | ||
stats.transferred += logObject.bytes; | ||
stats.addBytes(logObject.bytes); | ||
stats.requests++; | ||
@@ -26,0 +26,0 @@ stats.addClient(logObject.remoteHost); |
@@ -15,3 +15,3 @@ "use strict"; | ||
if (visible) { | ||
dope.cursorLinesUp(13); | ||
dope.cursorLinesUp(12); | ||
} else { | ||
@@ -18,0 +18,0 @@ visible = true; |
{ | ||
"name": "stream-log-stats", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/75lb/stream-log-stats.git", |
Sorry, the diff of this file is not supported yet
8651
187