Sha256: 060e0fe626dbed3c7c675c4780a9c66c35d02002d91009ea85eec44d1d1c9676

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

#!/usr/bin/env Rscript

# To use this to graph some benchmarks, install R (http://www.r-project.org/)
# and ggplot (http://ggplot2.org/).
#
# Once installed, you can generate some CSV output with a command like this:
#
#     $ OUTPUT_FORMAT=csv node benchmark/http/client-request-body.js > data.csv
#     $ ./benchmark/plot_csv.R data.csv data.png bytes type
#
# Where the 3rd argument to this script is the graph's X coordinate, the 4th is
# how the output is grouped, and the Y coordinate defaults to result.

library(methods)
library(ggplot2)

# get info from arguments
args <- commandArgs(TRUE)

csvFilename <- args[1]
graphFilename <- args[2]

xCoordinate <- args[3]
groupBy <- args[4]

# read data
data <- read.csv(file = csvFilename, head = TRUE)

# plot and save
plot <- ggplot(data = data, aes_string(x = xCoordinate, y = 'result', col = groupBy)) +
        geom_point(size = 5) +
        ggtitle(data$filename)

png(filename = graphFilename, width = 560, height = 480, units = 'px')
print(plot)
graphics.off()

cat(paste('Saved to', graphFilename, '\n'))

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
node-compiler-0.7.0 vendor/node-v6.9.1/benchmark/plot_csv.R