-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip: observers * wip: float observers * fix copy pasta * wip: rework observers in sdk * small fix in global meter * wip: aggregators and selectors * wip: monotonicity option for observers * some refactor * wip: docs needs more package docs (especially for api/metric and sdk/metric) * fix ci * Fix copy-pasta in docs Co-Authored-By: Mauricio Vásquez <[email protected]> * recycle unused recorders in observers if a recorder for a labelset is unused for a second collection cycle in a row, drop it * unregister * thread-safe set callback * Fix docs * Revert "wip: aggregators and selectors" This reverts commit 37b7d05. * update selector * tests * Rework number equality Compare concrete numbers, so we can get actual numbers in the error message when they are not equal, not some uint64 representation. This also uses InDelta for comparing floats. * Ensure that Observers are registered in the same order * Run observers in fixed order So the tests can be reproducible - iterating a map made the order of measurements random. * Ensure the proper alignment of the delegates This wasn't checked at all. After adding the checks, the test-386 failed. * Small tweaks to the global meter test * Ensure proper alignment of the callback pointer test-386 was complaining about it * update docs * update a TODO * address review issues * drop SetCallback Co-authored-by: Mauricio Vásquez <[email protected]> Co-authored-by: Rahul Patel <[email protected]>
- Loading branch information
1 parent
547d584
commit a202f16
Showing
16 changed files
with
1,074 additions
and
126 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,26 @@ | ||
package internal_test | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"go.opentelemetry.io/otel/api/global/internal" | ||
ottest "go.opentelemetry.io/otel/internal/testing" | ||
) | ||
|
||
// Ensure struct alignment prior to running tests. | ||
func TestMain(m *testing.M) { | ||
fieldsMap := internal.AtomicFieldOffsets() | ||
fields := make([]ottest.FieldOffset, 0, len(fieldsMap)) | ||
for name, offset := range fieldsMap { | ||
fields = append(fields, ottest.FieldOffset{ | ||
Name: name, | ||
Offset: offset, | ||
}) | ||
} | ||
if !ottest.Aligned8Byte(fields, os.Stderr) { | ||
os.Exit(1) | ||
} | ||
|
||
os.Exit(m.Run()) | ||
} |
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
Oops, something went wrong.