Skip to content

Instantly share code, notes, and snippets.

@mw2q
mw2q / dbt2-post-process-df.jl
Created Jan 3, 2020
post processing dbt2 mix.log with julia and data frames
View dbt2-post-process-df.jl
#!/usr/bin/env julia
using CSV
using DataFrames
using Printf
using Statistics
function displayreport(df::DataFrame)
errors = count(y -> (y .== "E"), skipmissing(df.code))
@mw2q
mw2q / dbt2-post-process.jl
Created Jan 3, 2020
post processing dbt2 mix.log with julia
View dbt2-post-process.jl
#!/usr/bin/env julia
using Printf
using Statistics
function process(mixfile::String)
ctime0 = missing
RampupTime = 0
StartTime = missing
SteadyStateTime = missing
@mw2q
mw2q / dbt2-post-process.r
Created Jan 3, 2020
post processing dbt2 mix.log with r
View dbt2-post-process.r
#!/usr/bin/env Rscript
mixfile = commandArgs(trailingOnly=TRUE)[1]
mix <- read.csv(file=mixfile, header=F)
colnames(mix) <- c('ctime', 'txn', 'status', 'response', 'pthread')
# Get the ctime after the START marker and the ctime before the first
# TERMINATED marker.
start <- mix[1,]$ctime
@mw2q
mw2q / dbt2-post-process.py
Created Jan 2, 2020
post processing dbt2 mix.log with python
View dbt2-post-process.py
#!/usr/bin/env python
import sys
from math import ceil, floor, fsum
def average(values):
count = float(len(values))
if count == 0:
return 0
return fsum(values) / float(len(values))
You can’t perform that action at this time.