solarwinds_apm 6.1.2 → 7.0.0.prev2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -3
  3. data/lib/rails/generators/solarwinds_apm/templates/solarwinds_apm_initializer.rb +1 -30
  4. data/lib/solarwinds_apm/api/current_trace_info.rb +10 -6
  5. data/lib/solarwinds_apm/api/custom_metrics.rb +8 -25
  6. data/lib/solarwinds_apm/api/tracing.rb +12 -27
  7. data/lib/solarwinds_apm/api/transaction_name.rb +6 -10
  8. data/lib/solarwinds_apm/config.rb +7 -1
  9. data/lib/solarwinds_apm/constants.rb +1 -0
  10. data/lib/solarwinds_apm/noop/api.rb +5 -2
  11. data/lib/solarwinds_apm/noop.rb +0 -24
  12. data/lib/solarwinds_apm/opentelemetry/otlp_processor.rb +116 -66
  13. data/lib/solarwinds_apm/opentelemetry/solarwinds_propagator.rb +0 -2
  14. data/lib/solarwinds_apm/opentelemetry/solarwinds_response_propagator.rb +5 -4
  15. data/lib/solarwinds_apm/opentelemetry.rb +5 -7
  16. data/lib/solarwinds_apm/otel_native_config.rb +180 -0
  17. data/lib/solarwinds_apm/patch/README.md +15 -0
  18. data/lib/solarwinds_apm/{noop/metadata.rb → sampling/dice.rb} +19 -17
  19. data/lib/solarwinds_apm/sampling/http_sampler.rb +87 -0
  20. data/lib/solarwinds_apm/sampling/json_sampler.rb +52 -0
  21. data/lib/solarwinds_apm/sampling/metrics.rb +38 -0
  22. data/lib/solarwinds_apm/sampling/oboe_sampler.rb +348 -0
  23. data/lib/solarwinds_apm/sampling/sampler.rb +197 -0
  24. data/lib/solarwinds_apm/sampling/sampling_constants.rb +127 -0
  25. data/lib/solarwinds_apm/sampling/sampling_patch.rb +49 -0
  26. data/lib/solarwinds_apm/sampling/setting_example.txt +1 -0
  27. data/lib/solarwinds_apm/{noop/context.rb → sampling/settings.rb} +14 -25
  28. data/lib/solarwinds_apm/sampling/token_bucket.rb +126 -0
  29. data/lib/solarwinds_apm/sampling/trace_options.rb +100 -0
  30. data/lib/solarwinds_apm/{patch.rb → sampling.rb} +20 -4
  31. data/lib/solarwinds_apm/support/logger_formatter.rb +1 -1
  32. data/lib/solarwinds_apm/support/logging_log_event.rb +1 -1
  33. data/lib/solarwinds_apm/support/lumberjack_formatter.rb +1 -1
  34. data/lib/solarwinds_apm/support/otlp_endpoint.rb +99 -0
  35. data/lib/solarwinds_apm/support/resource_detector.rb +192 -0
  36. data/lib/solarwinds_apm/support/service_key_checker.rb +12 -6
  37. data/lib/solarwinds_apm/support/transaction_settings.rb +6 -0
  38. data/lib/solarwinds_apm/support/txn_name_manager.rb +54 -9
  39. data/lib/solarwinds_apm/support/utils.rb +9 -0
  40. data/lib/solarwinds_apm/support.rb +2 -4
  41. data/lib/solarwinds_apm/version.rb +4 -4
  42. data/lib/solarwinds_apm.rb +27 -73
  43. metadata +107 -40
  44. data/ext/oboe_metal/extconf.rb +0 -168
  45. data/ext/oboe_metal/lib/liboboe-1.0-aarch64.so.sha256 +0 -1
  46. data/ext/oboe_metal/lib/liboboe-1.0-alpine-aarch64.so.sha256 +0 -1
  47. data/ext/oboe_metal/lib/liboboe-1.0-alpine-x86_64.so.sha256 +0 -1
  48. data/ext/oboe_metal/lib/liboboe-1.0-lambda-aarch64.so.sha256 +0 -1
  49. data/ext/oboe_metal/lib/liboboe-1.0-lambda-x86_64.so.sha256 +0 -1
  50. data/ext/oboe_metal/lib/liboboe-1.0-x86_64.so.sha256 +0 -1
  51. data/ext/oboe_metal/src/VERSION +0 -1
  52. data/ext/oboe_metal/src/bson/bson.h +0 -220
  53. data/ext/oboe_metal/src/bson/platform_hacks.h +0 -91
  54. data/ext/oboe_metal/src/init_solarwinds_apm.cc +0 -18
  55. data/ext/oboe_metal/src/oboe.h +0 -930
  56. data/ext/oboe_metal/src/oboe_api.cpp +0 -793
  57. data/ext/oboe_metal/src/oboe_api.h +0 -621
  58. data/ext/oboe_metal/src/oboe_debug.h +0 -17
  59. data/ext/oboe_metal/src/oboe_swig_wrap.cc +0 -11045
  60. data/lib/oboe_metal.rb +0 -187
  61. data/lib/solarwinds_apm/cert/star.appoptics.com.issuer.crt +0 -24
  62. data/lib/solarwinds_apm/noop/span.rb +0 -25
  63. data/lib/solarwinds_apm/oboe_init_options.rb +0 -222
  64. data/lib/solarwinds_apm/opentelemetry/solarwinds_exporter.rb +0 -239
  65. data/lib/solarwinds_apm/opentelemetry/solarwinds_processor.rb +0 -174
  66. data/lib/solarwinds_apm/opentelemetry/solarwinds_sampler.rb +0 -333
  67. data/lib/solarwinds_apm/otel_config.rb +0 -174
  68. data/lib/solarwinds_apm/otel_lambda_config.rb +0 -56
  69. data/lib/solarwinds_apm/patch/dummy_patch.rb +0 -12
  70. data/lib/solarwinds_apm/support/oboe_tracing_mode.rb +0 -33
  71. data/lib/solarwinds_apm/support/support_report.rb +0 -99
  72. data/lib/solarwinds_apm/support/transaction_cache.rb +0 -57
  73. data/lib/solarwinds_apm/support/x_trace_options.rb +0 -138
@@ -1,168 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright (c) 2016 SolarWinds, LLC.
4
- # All rights reserved.
5
-
6
- require 'mkmf'
7
- require 'rbconfig'
8
- require 'open-uri'
9
-
10
- CONFIG['warnflags'] = CONFIG['warnflags'].gsub('-Wdeclaration-after-statement', '')
11
- .gsub('-Wimplicit-function-declaration', '')
12
- .gsub('-Wimplicit-int', '')
13
- .gsub('-Wno-tautological-compare', '')
14
- .gsub('-Wno-self-assign', '')
15
- .gsub('-Wno-parentheses-equality', '')
16
- .gsub('-Wno-constant-logical-operand', '')
17
- .gsub('-Wno-cast-function-type', '')
18
- init_mkmf(CONFIG)
19
-
20
- ext_dir = __dir__
21
- oboe_env = ENV.fetch('OBOE_ENV', nil)
22
- non_production = %w[dev stg].include? oboe_env.to_s
23
-
24
- swo_lib_dir = File.join(ext_dir, 'lib')
25
- version = File.read(File.join(ext_dir, 'src', 'VERSION')).strip
26
-
27
- case oboe_env
28
- when 'dev'
29
- swo_path = 'https://solarwinds-apm-staging.s3.us-west-2.amazonaws.com/apm/c-lib/nightly'
30
- puts 'Fetching c-lib from DEVELOPMENT Build'
31
- when 'stg'
32
- swo_path = File.join('https://agent-binaries.global.st-ssp.solarwinds.com/apm/c-lib/', version)
33
- puts 'Fetching c-lib from STAGING Build'
34
- else
35
- swo_path = File.join('https://agent-binaries.cloud.solarwinds.com/apm/c-lib/', version)
36
- puts 'Fetching c-lib from PRODUCTION Build'
37
- end
38
-
39
- oboe_debug = ENV['OBOE_DEBUG'].to_s.casecmp('true').zero?
40
-
41
- if oboe_debug
42
- swo_path = File.join(swo_path, 'relwithdebinfo')
43
- puts "Fetching DEBUG Build based on #{oboe_env.to_s.empty? ? 'prod' : oboe_env}"
44
- end
45
-
46
- puts "final swo_path: #{swo_path}"
47
-
48
- swo_arch = 'x86_64'
49
- system_arch = `uname -m` # for mac, the command is `uname` # "Darwin\n"; try `uname -a`
50
- system_arch.delete!("\n")
51
- case system_arch
52
- when 'x86_64'
53
- swo_arch = 'x86_64'
54
- when 'aarch64' || 'arm64'
55
- swo_arch = 'aarch64'
56
- end
57
-
58
- if File.exist?('/etc/alpine-release')
59
- version = File.read('/etc/alpine-release').strip
60
-
61
- tmp_swo_arch = swo_arch.clone
62
- swo_arch =
63
- if Gem::Version.new(version) < Gem::Version.new('3.9')
64
- "alpine-libressl-#{tmp_swo_arch}"
65
- else # openssl
66
- "alpine-#{tmp_swo_arch}"
67
- end
68
- end
69
-
70
- swo_clib = "liboboe-1.0-#{swo_arch}.so"
71
- swo_clib = "liboboe-1.0-lambda-#{swo_arch}.so" if ENV['LAMBDA_TASK_ROOT'] || ENV['AWS_LAMBDA_FUNCTION_NAME']
72
- swo_item = File.join(swo_path, swo_clib)
73
- swo_checksum_file = File.join(swo_lib_dir, "#{swo_clib}.sha256")
74
- clib = File.join(swo_lib_dir, swo_clib)
75
-
76
- retries = 3
77
- success = false
78
- while retries.positive?
79
- begin
80
- IO.copy_stream(URI.parse(swo_item).open, clib)
81
- clib_checksum = Digest::SHA256.file(clib).hexdigest
82
- checksum = File.read(swo_checksum_file).strip
83
-
84
- # sha256 always from prod, so no matching for stg or nightly build or debug mode
85
- # so ignore the sha comparsion when fetching from development and staging build
86
- checksum = clib_checksum if non_production || oboe_debug
87
-
88
- # unfortunately these messages only show if the install command is run
89
- # with the `--verbose` flag
90
- if clib_checksum == checksum
91
- success = true
92
- else
93
- puts 'Checksum Verification Fail' # this is mainly for testing
94
- warn '== ERROR ================================================================='
95
- warn 'Checksum Verification failed for the c-extension of the solarwinds_apm gem'
96
- warn 'Installation cannot continue'
97
- warn "\nChecksum packaged with gem: #{checksum}"
98
- warn "Checksum calculated from lib: #{clib_checksum}"
99
- warn 'Contact technicalsupport@solarwinds.com if the problem persists'
100
- warn '=========================================================================='
101
- end
102
- retries = 0
103
- rescue StandardError => e
104
- File.write(clib, '')
105
- retries -= 1
106
- if retries.zero?
107
- warn '== ERROR =========================================================='
108
- warn 'Download of the c-extension for the solarwinds_apm gem failed.'
109
- warn 'solarwinds_apm will not instrument the code. No tracing will occur.'
110
- warn 'Contact technicalsupport@solarwinds.com if the problem persists.'
111
- warn "error: #{swo_item}\n#{e.message}"
112
- warn '==================================================================='
113
- create_makefile('oboe_noop', 'noop')
114
- end
115
- sleep 0.5
116
- end
117
- end
118
-
119
- if success
120
- # Create relative symlinks for the SolarWindsAPM library
121
- Dir.chdir(swo_lib_dir) do
122
- File.symlink(swo_clib, 'liboboe.so')
123
- File.symlink(swo_clib, 'liboboe-1.0.so.0')
124
- end
125
-
126
- dir_config('oboe', 'src', 'lib')
127
-
128
- # create Makefile
129
- if have_library('oboe')
130
- $libs = append_library($libs, 'oboe')
131
- $libs = append_library($libs, 'stdc++')
132
-
133
- $CFLAGS << " #{ENV.fetch('CFLAGS', nil)}"
134
-
135
- # -pg option is used for generating profiling information with gprof
136
- $CPPFLAGS << if oboe_debug
137
- " #{ENV.fetch('CPPFLAGS', nil)} -std=c++11 -gdwarf-2 -I$$ORIGIN/../ext/oboe_metal/src"
138
- else
139
- " #{ENV.fetch('CPPFLAGS', nil)} -std=c++11 -I$$ORIGIN/../ext/oboe_metal/src"
140
- end
141
-
142
- $LIBS << " #{ENV.fetch('LIBS', nil)}"
143
-
144
- # -lrt option is used when linking programs with the GNU Compiler Collection (GCC) to
145
- # include the POSIX real-time extensions library, librt.
146
- $LDFLAGS << " #{ENV.fetch('LDFLAGS', nil)} '-Wl,-rpath=$$ORIGIN/../ext/oboe_metal/lib' -lrt"
147
- $CXXFLAGS += ' -std=c++11 '
148
-
149
- # OBOE_DEBUG need to be enabled before downloading and installing the gem
150
- if oboe_debug
151
- CONFIG['debugflags'] = '-ggdb3 '
152
- CONFIG['optflags'] = '-O0'
153
- end
154
-
155
- create_makefile('libsolarwinds_apm', 'src')
156
- else
157
- warn '== ERROR ========================================================='
158
- if have_library('oboe')
159
- warn "The c-library either needs to be updated or doesn't match the OS."
160
- warn 'No tracing will occur.'
161
- else
162
- warn 'Could not find a matching c-library. No tracing will occur.'
163
- end
164
- warn 'Contact technicalsupport@solarwinds.com if the problem persists.'
165
- warn '=================================================================='
166
- create_makefile('oboe_noop', 'noop')
167
- end
168
- end
@@ -1 +0,0 @@
1
- 53295ec020a713c5f6fe7c14b150a10ac7db0e5ea692fbd6945ee69f7a581271
@@ -1 +0,0 @@
1
- 37407ece6aafcb662fbce8eb23f98a9b017154c66c8ec02eda835702ba14f446
@@ -1 +0,0 @@
1
- 925d65c2a940a82315525ea2e82eb357793f7db8a2a8ec529e7c03e2478bc965
@@ -1 +0,0 @@
1
- 3d49133827a0b6839744231e3ca49f8c9340380063286b8c3794bde585370001
@@ -1 +0,0 @@
1
- e2198827ce86309a59def33be14f17d0474477df33a5d75bd415d73a01c790b3
@@ -1 +0,0 @@
1
- 798a7c9551c66af743e1d6d2b736bf5667fa97fdc0ac8eec825fe4f63adaa044
@@ -1 +0,0 @@
1
- 15.0.3
@@ -1,220 +0,0 @@
1
- /* bson.h */
2
-
3
- /* Copyright 2009, 2010 10gen Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
-
18
- #ifndef _BSON_H_
19
- #define _BSON_H_
20
-
21
- #define MONGO_HAVE_STDINT
22
- #include "platform_hacks.h"
23
- #include <time.h>
24
-
25
- MONGO_EXTERN_C_START
26
-
27
- typedef enum {
28
- oboe_bson_error=-1,
29
- oboe_bson_eoo=0,
30
- oboe_bson_double=1,
31
- oboe_bson_string=2,
32
- oboe_bson_object=3,
33
- oboe_bson_array=4,
34
- oboe_bson_bindata=5,
35
- oboe_bson_undefined=6,
36
- oboe_bson_oid=7,
37
- oboe_bson_bool=8,
38
- oboe_bson_date=9,
39
- oboe_bson_null=10,
40
- oboe_bson_regex=11,
41
- oboe_bson_dbref=12, /* deprecated */
42
- oboe_bson_code=13,
43
- oboe_bson_symbol=14,
44
- oboe_bson_codewscope=15,
45
- oboe_bson_int = 16,
46
- oboe_bson_timestamp = 17,
47
- oboe_bson_long = 18
48
- } oboe_bson_type;
49
-
50
- typedef int oboe_bson_bool_t;
51
-
52
- typedef struct {
53
- char * data;
54
- oboe_bson_bool_t owned;
55
- } oboe_bson;
56
-
57
- typedef struct {
58
- const char * cur;
59
- oboe_bson_bool_t first;
60
- } oboe_bson_iterator;
61
-
62
- typedef struct {
63
- char * buf;
64
- char * cur;
65
- int bufSize;
66
- oboe_bson_bool_t finished;
67
- int stack[32];
68
- int stackPos;
69
- } oboe_bson_buffer;
70
-
71
- #pragma pack(1)
72
- typedef union{
73
- char bytes[12]; // Flawfinder: ignore
74
- int ints[3];
75
- } oboe_bson_oid_t;
76
- #pragma pack()
77
-
78
- typedef int64_t oboe_bson_date_t; /* milliseconds since epoch UTC */
79
-
80
- /* ----------------------------
81
- READING
82
- ------------------------------ */
83
-
84
-
85
- oboe_bson * oboe_bson_empty(oboe_bson * obj); /* returns pointer to static empty bson object */
86
- int oboe_bson_copy(oboe_bson* out, const oboe_bson* in); /* puts data in new buffer. NOOP if out==NULL */
87
- oboe_bson * oboe_bson_from_buffer(oboe_bson * b, oboe_bson_buffer * buf);
88
- oboe_bson * oboe_bson_init( oboe_bson * b , char * data , oboe_bson_bool_t mine );
89
- oboe_bson * oboe_bson_init_safe( oboe_bson * b , char * data , oboe_bson_bool_t mine , size_t buflen);
90
- int oboe_bson_size(const oboe_bson * b );
91
- void oboe_bson_destroy( oboe_bson * b );
92
-
93
- void oboe_bson_print( oboe_bson * b );
94
- void oboe_bson_print_raw( const char * bson , int depth );
95
-
96
- /* advances iterator to named field */
97
- /* returns bson_eoo (which is false) if field not found */
98
- oboe_bson_type oboe_bson_find(oboe_bson_iterator* it, const oboe_bson* obj, const char* name);
99
-
100
- void oboe_bson_iterator_init( oboe_bson_iterator * i , const char * bson );
101
-
102
- /* more returns true for eoo. best to loop with bson_iterator_next(&it) */
103
- oboe_bson_bool_t oboe_bson_iterator_more( const oboe_bson_iterator * i );
104
- oboe_bson_type oboe_bson_iterator_next( oboe_bson_iterator * i );
105
-
106
- oboe_bson_type oboe_bson_iterator_type( const oboe_bson_iterator * i );
107
- const char * oboe_bson_iterator_key( const oboe_bson_iterator * i );
108
- const char * oboe_bson_iterator_value( const oboe_bson_iterator * i );
109
-
110
- /* these convert to the right type (return 0 if non-numeric) */
111
- double oboe_bson_iterator_double( const oboe_bson_iterator * i );
112
- int oboe_bson_iterator_int( const oboe_bson_iterator * i );
113
- int64_t oboe_bson_iterator_long( const oboe_bson_iterator * i );
114
-
115
- /* false: boolean false, 0 in any type, or null */
116
- /* true: anything else (even empty strings and objects) */
117
- oboe_bson_bool_t oboe_bson_iterator_bool( const oboe_bson_iterator * i );
118
-
119
- /* these assume you are using the right type */
120
- double oboe_bson_iterator_double_raw( const oboe_bson_iterator * i );
121
- int oboe_bson_iterator_int_raw( const oboe_bson_iterator * i );
122
- int64_t oboe_bson_iterator_long_raw( const oboe_bson_iterator * i );
123
- oboe_bson_bool_t oboe_bson_iterator_bool_raw( const oboe_bson_iterator * i );
124
- oboe_bson_oid_t* oboe_bson_iterator_oid( const oboe_bson_iterator * i );
125
-
126
- /* these can also be used with bson_code and bson_symbol*/
127
- const char * oboe_bson_iterator_string( const oboe_bson_iterator * i );
128
- int oboe_bson_iterator_string_len( const oboe_bson_iterator * i );
129
-
130
- /* works with bson_code, bson_codewscope, and bson_string */
131
- /* returns NULL for everything else */
132
- const char * oboe_bson_iterator_code(const oboe_bson_iterator * i);
133
-
134
- /* calls bson_empty on scope if not a bson_codewscope */
135
- void oboe_bson_iterator_code_scope(const oboe_bson_iterator * i, oboe_bson * scope);
136
-
137
- /* both of these only work with bson_date */
138
- oboe_bson_date_t oboe_bson_iterator_date(const oboe_bson_iterator * i);
139
- time_t oboe_bson_iterator_time_t(const oboe_bson_iterator * i);
140
-
141
- int oboe_bson_iterator_bin_len( const oboe_bson_iterator * i );
142
- char oboe_bson_iterator_bin_type( const oboe_bson_iterator * i );
143
- const char * oboe_bson_iterator_bin_data( const oboe_bson_iterator * i );
144
-
145
- const char * oboe_bson_iterator_regex( const oboe_bson_iterator * i );
146
- const char * oboe_bson_iterator_regex_opts( const oboe_bson_iterator * i );
147
-
148
- /* these work with bson_object and bson_array */
149
- void oboe_bson_iterator_subobject(const oboe_bson_iterator * i, oboe_bson * sub);
150
- void oboe_bson_iterator_subiterator(const oboe_bson_iterator * i, oboe_bson_iterator * sub);
151
-
152
- /* str must be at least 24 hex chars + null byte */
153
- void oboe_bson_oid_from_string(oboe_bson_oid_t* oid, const char* str);
154
- void oboe_bson_oid_to_string(const oboe_bson_oid_t* oid, char* str);
155
- void oboe_bson_oid_gen(oboe_bson_oid_t* oid);
156
-
157
- time_t oboe_bson_oid_generated_time(oboe_bson_oid_t* oid); /* Gives the time the OID was created */
158
-
159
- /* ----------------------------
160
- BUILDING
161
- ------------------------------ */
162
-
163
- oboe_bson_buffer * oboe_bson_buffer_init( oboe_bson_buffer * b );
164
- oboe_bson_buffer * oboe_bson_ensure_space( oboe_bson_buffer * b , const int bytesNeeded );
165
-
166
- /**
167
- * @return the raw data. you either should free this OR call bson_destroy not both
168
- */
169
- char * oboe_bson_buffer_finish( oboe_bson_buffer * b );
170
- void oboe_bson_buffer_destroy( oboe_bson_buffer * b );
171
-
172
- oboe_bson_buffer * oboe_bson_append_oid( oboe_bson_buffer * b , const char * name , const oboe_bson_oid_t* oid );
173
- oboe_bson_buffer * oboe_bson_append_int( oboe_bson_buffer * b , const char * name , const int i );
174
- oboe_bson_buffer * oboe_bson_append_long( oboe_bson_buffer * b , const char * name , const int64_t i );
175
- oboe_bson_buffer * oboe_bson_append_double( oboe_bson_buffer * b , const char * name , const double d );
176
- oboe_bson_buffer * oboe_bson_append_string( oboe_bson_buffer * b , const char * name , const char * str );
177
- oboe_bson_buffer * oboe_bson_append_symbol( oboe_bson_buffer * b , const char * name , const char * str );
178
- oboe_bson_buffer * oboe_bson_append_code( oboe_bson_buffer * b , const char * name , const char * str );
179
- oboe_bson_buffer * oboe_bson_append_code_w_scope( oboe_bson_buffer * b , const char * name , const char * code , const oboe_bson * scope);
180
- oboe_bson_buffer * oboe_bson_append_binary( oboe_bson_buffer * b, const char * name, char type, const char * str, int len );
181
- oboe_bson_buffer * oboe_bson_append_bool( oboe_bson_buffer * b , const char * name , const oboe_bson_bool_t v );
182
- oboe_bson_buffer * oboe_bson_append_null( oboe_bson_buffer * b , const char * name );
183
- oboe_bson_buffer * oboe_bson_append_undefined( oboe_bson_buffer * b , const char * name );
184
- oboe_bson_buffer * oboe_bson_append_regex( oboe_bson_buffer * b , const char * name , const char * pattern, const char * opts );
185
- oboe_bson_buffer * oboe_bson_append_bson( oboe_bson_buffer * b , const char * name , const oboe_bson* bson);
186
- oboe_bson_buffer * oboe_bson_append_element( oboe_bson_buffer * b, const char * name_or_null, const oboe_bson_iterator* elem);
187
-
188
- /* these both append a bson_date */
189
- oboe_bson_buffer * oboe_bson_append_date(oboe_bson_buffer * b, const char * name, oboe_bson_date_t millis);
190
- oboe_bson_buffer * oboe_bson_append_time_t(oboe_bson_buffer * b, const char * name, time_t secs);
191
-
192
- oboe_bson_buffer * oboe_bson_append_start_object( oboe_bson_buffer * b , const char * name );
193
- oboe_bson_buffer * oboe_bson_append_start_array( oboe_bson_buffer * b , const char * name );
194
- oboe_bson_buffer * oboe_bson_append_finish_object( oboe_bson_buffer * b );
195
-
196
- void oboe_bson_numstr(char* str, int i);
197
- void oboe_bson_incnumstr(char* str);
198
-
199
-
200
- /* ------------------------------
201
- ERROR HANDLING - also used in mongo code
202
- ------------------------------ */
203
-
204
- void * oboe_bson_malloc(int size); /* checks return value */
205
-
206
- /* bson_err_handlers shouldn't return!!! */
207
- typedef void(*ob_bson_err_handler)(const char* errmsg);
208
-
209
- /* returns old handler or NULL */
210
- /* default handler prints error then exits with failure*/
211
- ob_bson_err_handler oboe_set_bson_err_handler(ob_bson_err_handler func);
212
-
213
-
214
-
215
- /* does nothing is ok != 0 */
216
- void oboe_bson_fatal( int ok );
217
- int oboe_bson_fatal_msg( int ok, const char* msg );
218
-
219
- MONGO_EXTERN_C_END
220
- #endif
@@ -1,91 +0,0 @@
1
- /* platform_hacks.h */
2
- /* Copyright 2009, 2010 10gen Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-
18
- /* all platform-specific ifdefs should go here */
19
-
20
- #ifndef _PLATFORM_HACKS_H_
21
- #define _PLATFORM_HACKS_H_
22
-
23
- #ifdef __GNUC__
24
- #define MONGO_INLINE static __inline__
25
- #else
26
- #define MONGO_INLINE static
27
- #endif
28
-
29
- #ifdef __cplusplus
30
- #define MONGO_EXTERN_C_START extern "C" {
31
- #define MONGO_EXTERN_C_END }
32
- #else
33
- #define MONGO_EXTERN_C_START
34
- #define MONGO_EXTERN_C_END
35
- #endif
36
-
37
-
38
- #if defined(MONGO_HAVE_STDINT) || __STDC_VERSION__ >= 199901L
39
- #include <stdint.h>
40
- #elif defined(MONGO_HAVE_UNISTD)
41
- #include <unistd.h>
42
- #elif defined(MONGO_USE__INT64)
43
- typedef __int64 int64_t;
44
- #elif defined(MONGO_USE_LONG_LONG_INT)
45
- typedef long long int int64_t;
46
- #else
47
- #error must have a 64bit int type
48
- #endif
49
-
50
- /* big endian is only used for OID generation. little is used everywhere else */
51
- #ifdef MONGO_BIG_ENDIAN
52
- #define oboe_bson_little_endian64(out, in) ( oboe_bson_swap_endian64(out, in) )
53
- #define oboe_bson_little_endian32(out, in) ( oboe_bson_swap_endian32(out, in) )
54
- #define oboe_bson_big_endian64(out, in) ( memmove(out, in, 8) )
55
- #define oboe_bson_big_endian32(out, in) ( memmove(out, in, 4) )
56
- #else
57
- #define oboe_bson_little_endian64(out, in) ( memmove(out, in, 8) )
58
- #define oboe_bson_little_endian32(out, in) ( memmove(out, in, 4) )
59
- #define oboe_bson_big_endian64(out, in) ( oboe_bson_swap_endian64(out, in) )
60
- #define oboe_bson_big_endian32(out, in) ( oboe_bson_swap_endian32(out, in) )
61
- #endif
62
-
63
- MONGO_EXTERN_C_START
64
-
65
- MONGO_INLINE void oboe_bson_swap_endian64(void* outp, const void* inp){
66
- const char *in = (const char*)inp;
67
- char *out = (char*)outp;
68
-
69
- out[0] = in[7];
70
- out[1] = in[6];
71
- out[2] = in[5];
72
- out[3] = in[4];
73
- out[4] = in[3];
74
- out[5] = in[2];
75
- out[6] = in[1];
76
- out[7] = in[0];
77
-
78
- }
79
- MONGO_INLINE void oboe_bson_swap_endian32(void* outp, const void* inp){
80
- const char *in = (const char*)inp;
81
- char *out = (char*)outp;
82
-
83
- out[0] = in[3];
84
- out[1] = in[2];
85
- out[2] = in[1];
86
- out[3] = in[0];
87
- }
88
-
89
- MONGO_EXTERN_C_END
90
-
91
- #endif
@@ -1,18 +0,0 @@
1
- // Copyright (c) 2019 SolarWinds, LLC.
2
- // All rights reserved.
3
-
4
- #include <iostream>
5
-
6
- #ifdef __cplusplus
7
- extern "C" {
8
- #endif
9
-
10
- void Init_oboe_metal(void);
11
-
12
- void Init_libsolarwinds_apm() {
13
- Init_oboe_metal();
14
- }
15
-
16
- #ifdef __cplusplus
17
- }
18
- #endif