-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add fluentd benchmark * Add more variants to error messages
- Loading branch information
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source 'https://rubygems.org' | ||
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | ||
|
||
gem 'fluentd' | ||
gem 'cool.io', github: 'k0kubun/cool.io', branch: 'ruby-3-3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
GIT | ||
remote: https://github.com/k0kubun/cool.io.git | ||
revision: 61e3caf8b961fb1a4d46b367eb58ebcddb45da4a | ||
branch: ruby-3-3 | ||
specs: | ||
cool.io (1.7.1) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
concurrent-ruby (1.2.2) | ||
fluentd (1.16.2) | ||
bundler | ||
cool.io (>= 1.4.5, < 2.0.0) | ||
http_parser.rb (>= 0.5.1, < 0.9.0) | ||
msgpack (>= 1.3.1, < 2.0.0) | ||
serverengine (>= 2.3.2, < 3.0.0) | ||
sigdump (~> 0.2.5) | ||
strptime (>= 0.2.4, < 1.0.0) | ||
tzinfo (>= 1.0, < 3.0) | ||
tzinfo-data (~> 1.0) | ||
webrick (~> 1.4) | ||
yajl-ruby (~> 1.0) | ||
http_parser.rb (0.8.0) | ||
msgpack (1.7.2) | ||
serverengine (2.3.2) | ||
sigdump (~> 0.2.2) | ||
sigdump (0.2.5) | ||
strptime (0.2.5) | ||
tzinfo (2.0.6) | ||
concurrent-ruby (~> 1.0) | ||
tzinfo-data (1.2023.3) | ||
tzinfo (>= 1.0.0) | ||
webrick (1.8.1) | ||
yajl-ruby (1.4.3) | ||
|
||
PLATFORMS | ||
arm64-darwin-22 | ||
x86_64-linux | ||
|
||
DEPENDENCIES | ||
cool.io! | ||
fluentd | ||
|
||
BUNDLED WITH | ||
2.4.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'harness' | ||
|
||
Dir.chdir(__dir__) | ||
use_gemfile | ||
|
||
require 'fluent/engine' | ||
require 'fluent/parser' | ||
|
||
# Prepare a fixture | ||
time = Time.new(2023, 7, 27, 9, 00, 00) | ||
errors = [ | ||
"Skipping user-data validation. No user-data found.", | ||
"Python version change detected. Purging cache", | ||
"No instance datasource found.", | ||
"No kernel command line url found.", | ||
"No local datasource found", | ||
] | ||
ltsv = 1000.times.map { |i| "time:#{time + i} module:main.py level:DEBUG message:#{errors.sample}\n" }.join | ||
ltsv *= 1000 | ||
|
||
# Prepare an LTSV parser | ||
parser = Fluent::Plugin::LabeledTSVParser.new | ||
parser.configure(Fluent::Config::Element.new('parse', '', {}, [])) | ||
|
||
# Benchmark the `<parse>@type ltsv</parse>` use case | ||
run_benchmark(10) do | ||
parser.parse(ltsv) {} | ||
end |