-
Notifications
You must be signed in to change notification settings - Fork 592
Mining Analysis #429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Mining Analysis #429
Changes from 36 commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
e9a9f11
base setup for miner opentel
temaniarpit27 f612c39
version change
temaniarpit27 6ca8301
modify ctx passing
temaniarpit27 767ee89
add attributes
temaniarpit27 bab7da1
update fill txs span attributes
manav2401 3a078e6
fix: use common attributes for remote and local txs
manav2401 c2602ca
pass context in seal
manav2401 1d9e1de
fix
manav2401 f252298
fix
manav2401 11bbda0
add traces to finalize and assemble
manav2401 4fb9770
fix
manav2401 75677c2
use task ctx in result loop
manav2401 59050f3
only start parent span if no error
manav2401 58d3540
send nil tracer from Finalize
manav2401 cb3a45e
Merge branch 'v0.3.0-dev' into arpit/pos-505
temaniarpit27 20a5a9d
clean up
manav2401 afef3b5
Merge branch 'arpit/pos-505' of https://github.com/maticnetwork/bor i…
manav2401 bcb11f2
add sub function timings in span attribute
manav2401 950bfe4
modify span attributes
manav2401 d848647
set time attribute to milliseconds
manav2401 cc1a18d
linters fix
temaniarpit27 6022e86
fix linters for consensus
manav2401 c9f3d25
add nolint to worker
manav2401 9d7ac22
fix testcase
temaniarpit27 99984dc
Added fillTransactions subTraces
0xsharma 064c125
Merge branch 'develop' into arpit/pos-505
temaniarpit27 9588aa9
add traces in intermediate root hash function
manav2401 acd192a
add traces in WriteBlockAndSetHead function, fix linters
manav2401 5ec3450
merge develop
temaniarpit27 30b559b
merge arpit/pos-505
temaniarpit27 1552167
fix: linting errors
temaniarpit27 b5dfe09
fix: test cases
temaniarpit27 9506630
fix: go.mod
temaniarpit27 5d356da
Merge branch 'develop' of github.com:maticnetwork/bor into arpit/pos-505
temaniarpit27 6f78f62
fix: testcase
temaniarpit27 b29e300
extract tracing package
JekaMas e36bc2b
merge
JekaMas aa8b1cc
Merge branch 'develop' into arpit/pos-505
manav2401 799fce1
Merge branch 'develop' into arpit/pos-505
manav2401 5d1189b
Merge branch 'develop' into arpit/pos-505
manav2401 10109b4
merge develop
temaniarpit27 82a21ac
merge base branch
temaniarpit27 478a7e0
linters fix
temaniarpit27 2d68b7c
debug
JekaMas 441a765
Revert "debug"
temaniarpit27 ae94046
fix: panic in NewTransactionsByPriceAndNonce iteration
manav2401 e1edcdf
Merge branch 'develop' of github.com:maticnetwork/bor into arpit/pos-505
temaniarpit27 9b995bc
Merge branch 'develop' into arpit/pos-505
manav2401 2ad0d64
merge develop
temaniarpit27 b9dc665
Merge branch 'arpit/pos-505' of github.com:maticnetwork/bor into arpi…
temaniarpit27 97e2840
merge develop
manav2401 aa532ee
change heimdall version to develop
temaniarpit27 9bdbc1e
miner/worker: fix duplicate call to tx ordering
manav2401 b8bc0b6
Merge branch 'arpit/pos-505' of https://github.com/maticnetwork/bor i…
manav2401 b726e53
Merge branch 'develop' of https://github.com/maticnetwork/bor into ar…
manav2401 9b4f796
miner/worker: refactor tracing
manav2401 b626090
consensus/bor: use tracing package
manav2401 4324423
tracing: add more abstraction for spans
manav2401 a810072
tracing: set all attributes at once
manav2401 0ab5821
Merge branch 'develop' into arpit/pos-505
temaniarpit27 54fef9c
remove nested tracing from blockchain.WriteBlockAndSetHead function
manav2401 c99de20
remove nested tracing from statedb.IntermediateRoot function
manav2401 b6ff133
handle end span in bor.Seal function
manav2401 91388bf
fix: typo
manav2401 f4a8a86
minor fixes
manav2401 c07ed79
fix: linters
manav2401 6e6268b
fix: remove nolint
manav2401 1d32559
go mod tidy
manav2401 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,81 @@ | ||
| package tracing | ||
|
|
||
| import ( | ||
| "context" | ||
| "time" | ||
|
|
||
| "go.opentelemetry.io/otel/attribute" | ||
| "go.opentelemetry.io/otel/trace" | ||
| ) | ||
|
|
||
| type tracerKey struct{} | ||
|
|
||
| type Option func(context.Context, trace.Span) | ||
|
|
||
| func WithTracer(ctx context.Context, tr trace.Tracer) context.Context { | ||
| return context.WithValue(ctx, tracerKey{}, tr) | ||
| } | ||
|
|
||
| func FromContext(ctx context.Context) trace.Tracer { | ||
| tr, _ := ctx.Value(tracerKey{}).(trace.Tracer) | ||
|
|
||
| return tr | ||
| } | ||
|
|
||
| func StartSpan(ctx context.Context, snapName string) (context.Context, trace.Span) { | ||
| tr := FromContext(ctx) | ||
| ctx, span := tr.Start(ctx, snapName) | ||
| ctx = WithTracer(ctx, tr) | ||
|
|
||
| return ctx, span | ||
| } | ||
|
|
||
| func Trace(ctx context.Context, spanName string) (context.Context, trace.Span) { | ||
| tr := FromContext(ctx) | ||
|
|
||
| if tr == nil { | ||
| return ctx, nil | ||
| } | ||
|
|
||
| return tr.Start(ctx, spanName) | ||
| } | ||
|
|
||
| func Exec(ctx context.Context, spanName string, opts ...Option) { | ||
| var span trace.Span | ||
|
|
||
| tr := FromContext(ctx) | ||
|
|
||
| if tr != nil { | ||
| ctx, span = tr.Start(ctx, spanName) | ||
| } | ||
|
|
||
| for _, optFn := range opts { | ||
| optFn(ctx, span) | ||
| } | ||
|
|
||
| if tr != nil { | ||
| span.End() | ||
| } | ||
|
|
||
| return | ||
| } | ||
|
|
||
| func WithTime(fn func(context.Context, trace.Span)) Option { | ||
| return func(ctx context.Context, span trace.Span) { | ||
| ElapsedTime(ctx, span, "elapsed", fn) | ||
| } | ||
| } | ||
|
|
||
| func ElapsedTime(ctx context.Context, span trace.Span, msg string, fn func(context.Context, trace.Span)) { | ||
| var now time.Time | ||
|
|
||
| if span != nil { | ||
| now = time.Now() | ||
| } | ||
|
|
||
| fn(ctx, span) | ||
|
|
||
| if span != nil { | ||
| span.SetAttributes(attribute.Int(msg, int(time.Since(now).Milliseconds()))) | ||
| } | ||
| } | ||
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.