forked from gocardless/fluent-plugin-gcloud-pubsub-custom
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Set a default ruby version * Remove deprecated has_rdoc option This has been deprecated [since 2011][0] [0]: https://github.com/rubygems/rubygems/blob/1aebd7ddd69c9a38aa9daa3aa89f396d59c9e2a4/History.txt#L3296-L3297 * Add rubocop configuration * Add rubocop fixups and configuration Use the rubocop generated configuration to ignore any major changes that can't be auto-corrected. * Adjust supported Ruby versions Ruby 2.4 is now end-of-life. As a result of this, the `google-protobuf` gem is no longer releasing artifacts compatible with this version. (protocolbuffers/protobuf#7453) In CI we encounter this error from `bundle install`: ``` google-protobuf-3.12.0-x86_64-linux requires ruby version >= 2.5, which is incompatible with the current version, ruby 2.4.6p354 ``` Therefore remove Ruby 2.4.6 as a tested version in Travis CI. Additionally remove the constraint on patch versions in the Travis config, so that we'll use the latest patch version available for each release branch. * Add Prometheus metrics Augment the existing operations with Prometheus metrics in order to provide observability around the operations that the plugin is performing. Introduce a new metrics helper to prevent attempting to register the same metric more than once in a multi-threaded or multi-instance context. * Add compress_batches feature As per the README updates, this can be used to compress a number of input records into a single Pub/Sub message, therefore saving on costs. * Include gocardless branch in Travis config * Minor README fixups Clarify that the published bytes value is before compression. Correct the name of the name of the compression ratio metric. * publish to rubygems Co-authored-by: Ben Wheatley <contact@benwh.com> Co-authored-by: Calvin Aditya Jonathan <calvin.aditya@bukalapak.com>
- Loading branch information
1 parent
e2d6ada
commit 174c354
Showing
16 changed files
with
930 additions
and
326 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
inherit_from: .rubocop_todo.yml | ||
|
||
AllCops: | ||
# Matches the minimum version in .travis.yml | ||
TargetRubyVersion: 2.4 | ||
|
||
Style/StringLiterals: | ||
EnforcedStyle: "double_quotes" | ||
|
||
# New cops: https://docs.rubocop.org/en/latest/versioning/ | ||
Layout/EmptyLinesAroundAttributeAccessor: | ||
Enabled: true | ||
|
||
Layout/SpaceAroundMethodCallOperator: | ||
Enabled: true | ||
|
||
Lint/RaiseException: | ||
Enabled: true | ||
|
||
Lint/StructNewOverride: | ||
Enabled: true | ||
|
||
Style/ExponentialNotation: | ||
Enabled: true | ||
|
||
Style/HashEachMethods: | ||
Enabled: true | ||
|
||
Style/HashTransformKeys: | ||
Enabled: true | ||
|
||
Style/HashTransformValues: | ||
Enabled: true | ||
|
||
Style/SlicingWithRange: | ||
Enabled: true | ||
|
||
Style/TrailingCommaInHashLiteral: | ||
EnforcedStyleForMultiline: comma | ||
|
||
Style/TrailingCommaInArrayLiteral: | ||
EnforcedStyleForMultiline: comma | ||
|
||
Style/TrailingCommaInArguments: | ||
EnforcedStyleForMultiline: comma |
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,98 @@ | ||
--- | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2020-05-12 17:34:19 +0100 using RuboCop version 0.83.0. | ||
# The point is for the user to remove these configuration records | ||
# one by one as the offenses are removed from the code base. | ||
# Note that changes in the inspected code, or installation of new | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
# Offense count: 3 | ||
# Configuration parameters: IgnoredMethods. | ||
Metrics/AbcSize: | ||
Max: 50 | ||
|
||
Metrics/BlockLength: | ||
Enabled: false | ||
|
||
Metrics/ClassLength: | ||
Enabled: false | ||
|
||
Metrics/MethodLength: | ||
Max: 30 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: IgnoredPatterns. | ||
# SupportedStyles: snake_case, camelCase | ||
Naming/MethodName: | ||
EnforcedStyle: snake_case | ||
|
||
# Offense count: 3 | ||
# Cop supports --auto-correct. | ||
# Configuration parameters: AutoCorrect, EnforcedStyle. | ||
# SupportedStyles: nested, compact | ||
Style/ClassAndModuleChildren: | ||
Exclude: | ||
- 'lib/fluent/plugin/in_gcloud_pubsub.rb' | ||
- 'lib/fluent/plugin/out_gcloud_pubsub.rb' | ||
- 'test/test_helper.rb' | ||
|
||
# Offense count: 6 | ||
Style/Documentation: | ||
Exclude: | ||
- 'spec/**/*' | ||
- 'test/**/*' | ||
- 'lib/fluent/plugin/gcloud_pubsub/client.rb' | ||
- 'lib/fluent/plugin/in_gcloud_pubsub.rb' | ||
- 'lib/fluent/plugin/out_gcloud_pubsub.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: AllowedVariables. | ||
Style/GlobalVars: | ||
Exclude: | ||
- 'test/test_helper.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: MinBodyLength. | ||
Style/GuardClause: | ||
Exclude: | ||
- 'lib/fluent/plugin/gcloud_pubsub/client.rb' | ||
|
||
# Offense count: 2 | ||
# Cop supports --auto-correct. | ||
Style/IfUnlessModifier: | ||
Exclude: | ||
- 'lib/fluent/plugin/gcloud_pubsub/client.rb' | ||
|
||
# Offense count: 1 | ||
Style/MethodMissingSuper: | ||
Exclude: | ||
- 'test/test_helper.rb' | ||
|
||
# Offense count: 1 | ||
Style/MissingRespondToMissing: | ||
Exclude: | ||
- 'test/test_helper.rb' | ||
|
||
# Offense count: 260 | ||
# Cop supports --auto-correct. | ||
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. | ||
# SupportedStyles: single_quotes, double_quotes | ||
Style/StringLiterals: | ||
Exclude: | ||
- 'Gemfile' | ||
- 'Rakefile' | ||
- 'fluent-plugin-gcloud-pubsub-custom.gemspec' | ||
- 'lib/fluent/plugin/gcloud_pubsub/client.rb' | ||
- 'lib/fluent/plugin/in_gcloud_pubsub.rb' | ||
- 'lib/fluent/plugin/out_gcloud_pubsub.rb' | ||
- 'test/plugin/test_in_gcloud_pubsub.rb' | ||
- 'test/plugin/test_out_gcloud_pubsub.rb' | ||
- 'test/test_helper.rb' | ||
|
||
# Offense count: 36 | ||
# Cop supports --auto-correct. | ||
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. | ||
# URISchemes: http, https | ||
Layout/LineLength: | ||
Max: 120 |
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 @@ | ||
2.6.5 |
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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
source 'https://rubygems.org' | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
gemspec |
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 |
---|---|---|
@@ -1,12 +1,14 @@ | ||
require 'bundler' | ||
# frozen_string_literal: true | ||
|
||
require "bundler" | ||
Bundler::GemHelper.install_tasks | ||
|
||
require 'rake/testtask' | ||
require "rake/testtask" | ||
|
||
Rake::TestTask.new(:test) do |test| | ||
test.libs << 'lib' << 'test' | ||
test.test_files = FileList['test/plugin/test_*.rb'] | ||
test.libs << "lib" << "test" | ||
test.test_files = FileList["test/plugin/test_*.rb"] | ||
test.verbose = true | ||
end | ||
|
||
task :default => [:build] | ||
task default: [:build] |
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 |
---|---|---|
@@ -1,26 +1,32 @@ | ||
# encoding: utf-8 | ||
$:.push File.expand_path('../lib', __FILE__) | ||
# frozen_string_literal: true | ||
|
||
$LOAD_PATH.push File.expand_path("lib", __dir__) | ||
|
||
Gem::Specification.new do |gem| | ||
gem.name = "fluent-plugin-gcloud-pubsub-custom" | ||
gem.description = "Google Cloud Pub/Sub input/output plugin for Fluentd event collector" | ||
gem.name = "fluent-plugin-gcloud-pubsub-custom-compress-batches" | ||
gem.description = "Google Cloud Pub/Sub input/output plugin for Fluentd event collector - with payload compression. Forked from https://github.com/gocardless/fluent-plugin-gcloud-pubsub-custom" | ||
gem.license = "MIT" | ||
gem.homepage = "https://github.com/mia-0032/fluent-plugin-gcloud-pubsub-custom" | ||
gem.summary = gem.description | ||
gem.version = "1.3.2" | ||
gem.authors = ["Yoshihiro MIYAI"] | ||
gem.email = "msparrow17@gmail.com" | ||
gem.has_rdoc = false | ||
gem.homepage = "https://github.com/calvinaditya95/fluent-plugin-gcloud-pubsub-custom" | ||
gem.summary = "Google Cloud Pub/Sub input/output plugin for Fluentd event collector - with payload compression" | ||
gem.version = "1.3.3" | ||
gem.authors = ["Calvin Aditya"] | ||
gem.email = "calvin.aditya95@gmail.com" | ||
gem.files = `git ls-files`.split("\n") | ||
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") | ||
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } | ||
gem.require_paths = ['lib'] | ||
gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) } | ||
gem.require_paths = ["lib"] | ||
|
||
gem.add_runtime_dependency "fluentd", [">= 0.14.15", "< 2"] | ||
gem.add_runtime_dependency "google-cloud-pubsub", "~> 0.30.0" | ||
|
||
# Use the same version constraint as fluent-plugin-prometheus currently specifies | ||
gem.add_runtime_dependency "prometheus-client", "< 0.10" | ||
|
||
gem.add_development_dependency "bundler" | ||
gem.add_development_dependency "pry" | ||
gem.add_development_dependency "pry-byebug" | ||
gem.add_development_dependency "rake" | ||
gem.add_development_dependency "rubocop", "~>0.83" | ||
gem.add_development_dependency "test-unit" | ||
gem.add_development_dependency "test-unit-rr" | ||
end |
Oops, something went wrong.