Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lambda-cloud-watch-log-parser

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda-cloud-watch-log-parser - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

24

lib/parser.js

@@ -72,2 +72,16 @@ "use strict"

/**
* Calculates the cost of the function run.
*
* @sync
* @method calculateLambdaCost
* @param {Number} duration The length of time the function ran. This number should be in milliseconds.
* @param {Number} function_size The size of the function that was ran.
*/
LogParser.prototype.calculateFunctionCost = function (duration, function_size) {
var cost_per_gb_sec = .00001667;
return (cost_per_gb_sec / (1024 / function_size)) * (duration / 1000);
};
/**
* Takes the log data and parses it.

@@ -131,7 +145,11 @@ *

}
if(usage.request_id === request_id){
log.usage.request_id = usage.request_id;
log.usage.billed_duration = usage.billed_duration;
log.usage.memory_size = usage.memory_size;
log.usage.max_memory_size = usage.max_memory_size;
log.usage.billed_duration = parseInt(usage.billed_duration.replace('ms', '').trim());
log.usage.memory_size = parseInt(usage.memory_size.replace('MB', '').trim());
log.usage.max_memory_size = parseInt(usage.max_memory_size.replace('MB', '').trim());
log.usage.cost = _this.calculateFunctionCost(log.usage.billed_duration, log.usage.memory_size);
}

@@ -138,0 +156,0 @@ }

2

package.json
{
"name": "lambda-cloud-watch-log-parser",
"description": "Parses event data from cloud watch logs.",
"version": "0.0.7",
"version": "0.0.8",
"private": false,

@@ -6,0 +6,0 @@ "dependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc