Skip to content

Instantly share code, notes, and snippets.

View FrancescaK's full-sized avatar

Francesca Krihely FrancescaK

View GitHub Profile
@FrancescaK
FrancescaK / BBD-BSON 1
Created August 7, 2013 22:47
BBD-BSON1
Given /^an IO stream containing ([0-9a-fA-F]+)$/ do |hex_bytes|
@io = StringIO.new([hex_bytes].pack('H*'))
end
When /^I deserialize the stream$/ do
@document = Hash.from_bson(@io)
end
Then /^the result should be the ((?:\S+) value (?:\S+))$/ do |value|
@document['k'].should eq(value)
@FrancescaK
FrancescaK / Step_def
Last active December 20, 2015 18:58
Step Definitions
Given /^an IO stream containing ([0-9a-fA-F]+)$/ do |hex_bytes|
@io = StringIO.new([hex_bytes].pack('H*'))
end
When /^I deserialize the stream$/ do
@document = Hash.from_bson(@io)
end
Then /^the result should be the ((?:\S+) value (?:\S+))$/ do |value|
@document['k'].should eq(value)
@FrancescaK
FrancescaK / Cucumber_BSON
Last active December 20, 2015 18:49
Cucumber_BSON
@bson
Feature: Deserialize Elements
As a user of MongoDB
In order to retrieve data from the database
The driver needs to deserialize BSON elements
Scenario Outline: Deserialize singleton BSON objects
Given an IO stream containing <hex_bytes>
When I deserialize the stream
Then the result should be the <type> value <value>
@FrancescaK
FrancescaK / Cucumber_Output
Last active December 20, 2015 18:49
Cucumber Output
Feature: Addition
As someone who works with numbers
I want to be able to learn the total of my numbers
So I add my numbers together to get a result
Scenario: Adding two numbers # features/adding.feature:6
Given the number 5 # features/step_definitions/step_definitions.rb:1
And the other number 42 # features/step_definitions/step_definitions.rb:5
When I add the two numbers # features/step_definitions/step_definitions.rb:9
Then the result should be 47 # features/step_definitions/step_definitions.rb:13
@FrancescaK
FrancescaK / BDD Action
Last active December 20, 2015 18:49
BDD In action
Given /^the number (-?\d+)$/ do |addend|
@addend1 = addend.to_i
end
Given /^the other number (-?\d+)$/ do |addend|
@addend2 = addend.to_i
end
When /^I add the two numbers$/ do
@sum = @addend1 + @addend2
@FrancescaK
FrancescaK / BDDFramework
Last active December 20, 2015 18:49
Behavior-Driven Development Framework
Feature: Addition
As someone who works with numbers
I want to be able to learn the total of my numbers
So I add my numbers together to get a result
Scenario: Adding two numbers
Given the number 5
And the other number 42
When I add the two numbers
Then the result should be 47
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
28564 dwight 20 0 1292m 1.0g 1.0g S 609.1 3.3 0:47.11 mongoperf
parsed options:
{ nThreads: 32, fileSizeMB: 1000, r: true, mmf: true }
creating test file size:1000MB ...
testing...
new thread, total running : 1
67 ops/sec
110 ops/sec
184 ops/sec
167 ops/sec
174 ops/sec
@FrancescaK
FrancescaK / iostat2
Created January 17, 2013 16:18
iostat for mmf:true
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util
sdc 148.33 0.00 116.00 0.00 22.30 0.00 393.63 1.68 14.48 7.19 83.40
sdd 130.67 0.00 113.00 0.00 20.38 0.00 369.35 1.54 13.58 7.19 81.23
sde 154.00 0.00 113.67 0.00 21.85 0.00 393.64 1.84 16.23 7.38 83.87
sdb 140.00 0.00 107.00 0.00 20.27 0.00 387.91 1.88 17.58 7.84 83.87
md0 0.00 0.00 1025.33 0.00 85.34 0.00 170.45 0.00 0.00 0.00 0.00
@FrancescaK
FrancescaK / mongoperftrue
Created January 17, 2013 16:13
sample mmf:true response
parsed options:
{ recSizeKB: 8, nThreads: 8, fileSizeMB: 1000, r: true, mmf: true }
creating test file size:1000MB ...
new thread, total running : 1
read:1 write:0
65 ops/sec
79 ops/sec
92 ops/sec
107 ops/sec
111 ops/sec