class Beetle::CSVArchiver

Overview

A subclass of Archiver that writes (appends) Job and Execution data to a series of .csv files.

For example:

archiver = Beetle::CSVArchiver.new(".")
s = Beetle::Server.new
s.archiver = archiver
:
s.listen

Defined in:

beetle/archiver/csv-archiver.cr

Constructors

Instance Method Summary

Instance methods inherited from class Beetle::Archiver

archive(job_exec : JobExec) archive

Constructor Detail

def self.new(path : String) #

Creates a new CSVArchiver setting the base directory to path. All csv files will be created or appended to under this directory.


[View source]

Instance Method Detail

def archive(job_exec : JobExec) #

Creates (or appends to) a series of csv files under path on completion of a Job execution. The files and their corresponding fields are:

beetle-job.csv - Job Details

  • Unique Job ID (UUID)
  • Job Name
  • Host (may be null)
  • Maximum run time in seconds
  • Number of requests to be made by each swarm member
  • Number in the swarm
  • Execution timestamp (in UTC)
  • Elapsed time (in microseconds) to execute the Job
  • Threshold was exceeded (1) or not (0)

beetle-job-params.csv - Job Parameters

  • Job ID (contained in beetle-job.csv)
  • Parameter name
  • Parameter value

beetle-job-task.csv - Tasks defined for the Job

  • Job ID (contained in beetle-job.csv)
  • Task Class (subclass of Beetle::Task)
  • Host (refer to JobTask#host)
  • Task Weight (refer to JobTask#weight)
  • Min sleep time between requests in milliseconds (refer to JobTask#sleep_min_msec)
  • Max sleep time between requests in milliseconds (refer to JobTask#sleep_max_msec)
  • Threshold average execution time in microseconds (refer to JobTask#threshold_avg_usec)
  • Threshold maximum execution time in microseconds (refer to JobTask#threshold_avg_usec)
  • Number of executions of this Task Class
  • Number of successful executions
  • Number of failed executions
  • Minimum elapsed time of all executions in microseconds
  • Maximum elapsed time of all executions in microseconds
  • Average elapsed time of all executions in microseconds
  • Total elapsed time of all executions in microseconds
  • Threshold average execution time was exceeded (1) or not (0)
  • Threshold maximum execution time was exceeded (1) or not (0)

beetle-task-exec.csv - Individual task requests made by swarm worker(s)

  • Job ID (contained in beetle-job.csv)
  • Unique request ID (UUID. Set in X-Request-ID header of http request)
  • Id of worker in swarm
  • Task Class (subclass of Beetle::Task)
  • Start Timestamp (in UTC)
  • Elapsed time in microseconds
  • Error body
  • Success (1) or failure (0)

[View source]