Skip to content

Instantly share code, notes, and snippets.

View lantins's full-sized avatar

Luke Antins lantins

View GitHub Profile
{
"id": 200,
"deploy_timestamp": 1328644101,
"log_output":"csv",
"process_output":"csv",
"canbus": {},
"internal": {
ruby -Ilib bin/imss-end-point --client-config $PWD/test/configs -f
\u@\h:\w [$(~/.rvm/bin/rvm-prompt)]$(__git_ps1)\$
require 'benchmark'
imei = '0000000000000100'
n = 500_000
Benchmark.bmbm do |x|
x.report('scan') { for i in 1..n; imei.scan(/(.{2})(.{6})(.{6})/).join('-'); end }
x.report('sub') { for i in 1..n; imei.sub(/(.{2})(.{6})(.{6}).*/, '\1-\2-\3'); end }
x.report('gsub') { for i in 1..n; imei.gsub(/(.{2})(.{6})(.{6}).*/, '\1-\2-\3'); end }
class User
attr_accessor :products
def initialize
@products = ProductsArray.new
end
end
class ProductsArray < Array
# Notes
#
# 1) Per exception retry delays should work without needing to duplicate
# exceptions in `@retry_exceptions`.
#
class ExceptionSpecificJob1 < RetryDefaultsJob
extend Resque::Plugins::Retry
@queue = :testing
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16)
Signal0=0x520, 1, "chan a temp", "degc", 0, 0, 16, 0.03125, -273, 0, 1319, 0, -1, 0, "", -1, -1;
0x520 (1) int message id
1 int --- ignored ---
"chan a temp" (2) string signal name
"degc" (3) string unit
0 (4) int data type (unsigned = 1 ???, signed = 0 ???, float = 3 ???)
0 (5) int bit address
16 (6) int bit length
[Mon, 14 Nov 2011 16:22:28 GMT] [info] [<0.32.0>] Apache CouchDB has started on http://10.6.9.53:5984/
[Mon, 14 Nov 2011 16:22:28 GMT] [error] [<0.31.0>] {error_report,<0.31.0>,
{<0.31.0>,crash_report,
[[{initial_call,
{application_master,init,
['Argument__1','Argument__2','Argument__3',
'Argument__4']}},
{pid,<0.31.0>},
{registered_name,[]},
{error_info,
[Mon, 14 Nov 2011 15:17:06 GMT] [error] [<0.20.0>] {error_report,<0.9.0>,
{<0.20.0>,std_error,
"File operation error: eacces. Target: ./couch_rep_sup.beam. Function: get_file. Process: code_server."}}
[Mon, 14 Nov 2011 15:17:06 GMT] [error] [<0.20.0>] {error_report,<0.9.0>,
{<0.20.0>,std_error,
"File operation error: eacces. Target: ./httpd_util.beam. Function: get_file. Process: code_server."}}
[Mon, 14 Nov 2011 15:17:06 GMT] [error] [<0.20.0>] {error_report,<0.9.0>,
{<0.20.0>,std_error,
"File operation error: eacces. Target: ./couch_task_status.beam. Function: get_file. Process: code_server."}}
[Mon, 14 Nov 2011 15:17:06 GMT] [error] [<0.20.0>] {error_report,<0.9.0>,

AVRO will perform byte-aligned packing. e.g. if you have 64 bits storage but only require 28 bits you will use 32 bits.

+-----------------------+
| SLOW LOGGING          |
+---------+-------------+----------+----------+---------------+----------------+
| signals | signal size | log rate | log time | total samples | avro file size |
+---------+-------------+----------+----------+---------------+----------------+
|      64 |       8 bit |     10 s |   1 hour |           360 |     0.03 Mbyte |

| 64 | 16 bit | 10 s | 1 hour | 360 | 0.06 Mbyte |