Skip to content

Commit 457f4e2

Browse files
heyamstrask
andauthored
Collect perf counters using Oshi (#1482)
* Collect system.disk.io and total processor time using oshi java library * Send old perf using JNI for testing purpose * Address comments * Use process io instead of disk.io * Address feedback * Use milliseconds to track elapsed seconds instead of nanoSeconds, which might end up negative values * Fix total CPU processor time big diff from JNI * Compute perf counter values during class startup * Update oshi version * Use system cpu * Remove old windows jni perf counters * Replace unix perf counters also * Remove old unix counters * Remove unused constants * Unify windows and unix code * Merge conflicts Co-authored-by: Trask Stalnaker <[email protected]>
1 parent e5c8ce0 commit 457f4e2

34 files changed

+144
-1994
lines changed

.pipelines/pipeline.user.windows.buddy.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,10 @@ version:
66
system: 'custom'
77
build:
88
commands:
9-
- !!buildcommand
10-
name: 'Assemble Perf Counters DLL'
11-
command: '.scripts/gradle.cmd'
12-
arguments: ':core:windowsSharedLibrary'
13-
artifacts:
14-
- from: 'core/build/libs/windows/shared'
15-
include:
16-
- '**/*'
17-
exclude:
18-
- '**/*.pdb'
19-
signing_options:
20-
profile: external_distribution
21-
sign_inline: true
22-
logs:
23-
- to: 'PerfCounters DLL Build Logs'
24-
from: 'core/build/tmp'
25-
include:
26-
- '*WindowsCpp/*'
279
- !!buildcommand
2810
name: 'Assemble ApplicationInsights-Java JARs'
2911
command: '.scripts/gradle.cmd'
30-
arguments: 'assemble -Pcore.native.artifacts.prebuilt=true'
12+
arguments: 'assemble'
3113
artifacts:
3214
- to: 'Artifacts'
3315
include:

.pipelines/pipeline.user.windows.official.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,10 @@ version:
55
system: 'custom'
66
build:
77
commands:
8-
- !!buildcommand
9-
name: 'Assemble Perf Counters DLL'
10-
command: '.scripts/gradle.cmd'
11-
arguments: ':core:windowsSharedLibrary'
12-
artifacts:
13-
- from: 'core/build/libs/windows/shared'
14-
include:
15-
- '**/*'
16-
exclude:
17-
- '**/*.pdb'
18-
signing_options:
19-
profile: external_distribution
20-
sign_inline: true
21-
logs:
22-
- to: 'PerfCounters DLL Build Logs'
23-
from: 'core/build/tmp'
24-
include:
25-
- '*WindowsCpp/*'
268
- !!buildcommand
279
name: 'Assemble ApplicationInsights-Java JARs'
2810
command: '.scripts/gradle.cmd'
29-
arguments: 'assemble -Pcore.native.artifacts.prebuilt=true -DisRelease=true -Pai.etw.native.build=release'
11+
arguments: 'assemble -DisRelease=true -Pai.etw.native.build=release'
3012
artifacts:
3113
- to: 'Artifacts'
3214
include:

.pipelines/pipeline.user.windows.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ static_analysis_options:
2020
fail_on_error: true
2121
restore:
2222
commands:
23-
- !!defaultcommand
24-
name: 'Install Windows 8.1 SDK'
25-
command: '.scripts/installWindows81Sdk.cmd'
26-
logs:
27-
- from: 'WinSdkInstall'
28-
to: 'WinSdkInstall'
29-
include:
30-
- '**/*.log'
3123
- !!defaultcommand
3224
name: 'Install Windows 10 SDK'
3325
command: '.scripts/installWindows10Sdk.cmd'

.scripts/installWindows81Sdk.cmd

Lines changed: 0 additions & 26 deletions
This file was deleted.

agent/agent-tooling/gradle/dependency-locks/compileClasspath.lockfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ch.qos.logback.contrib:logback-json-classic:0.1.5
55
ch.qos.logback.contrib:logback-json-core:0.1.5
66
ch.qos.logback:logback-classic:1.2.3
77
ch.qos.logback:logback-core:1.2.3
8+
com.github.oshi:oshi-core:5.6.0
89
com.google.code.findbugs:jsr305:3.0.2
910
com.google.code.gson:gson:2.8.2
1011
com.google.errorprone:error_prone_annotations:2.2.0
@@ -35,6 +36,8 @@ io.opentelemetry:opentelemetry-sdk-trace:1.0.0
3536
io.opentelemetry:opentelemetry-sdk:1.0.0
3637
io.opentelemetry:opentelemetry-semconv:1.0.1-alpha
3738
net.bytebuddy:byte-buddy:1.10.10
39+
net.java.dev.jna:jna-platform:5.7.0
40+
net.java.dev.jna:jna:5.7.0
3841
org.apache.commons:commons-lang3:3.11
3942
org.apache.commons:commons-text:1.9
4043
org.apache.httpcomponents:httpclient:4.5.13

agent/agent-tooling/gradle/dependency-locks/runtimeClasspath.lockfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Manual edits can break the build and are not advised.
33
# This file is expected to be part of source control.
44
com.blogspot.mydailyjava:weak-lock-free:0.15
5+
com.github.oshi:oshi-core:5.6.0
56
com.google.auto.service:auto-service-annotations:1.0-rc7
67
com.google.auto.service:auto-service:1.0-rc7
78
com.google.auto:auto-common:0.10
@@ -43,6 +44,8 @@ io.prometheus:simpleclient_common:0.9.0
4344
io.prometheus:simpleclient_httpserver:0.9.0
4445
net.bytebuddy:byte-buddy-agent:1.10.18
4546
net.bytebuddy:byte-buddy:1.10.18
47+
net.java.dev.jna:jna-platform:5.7.0
48+
net.java.dev.jna:jna:5.7.0
4649
org.apache.commons:commons-lang3:3.11
4750
org.apache.commons:commons-text:1.9
4851
org.apache.httpcomponents:httpclient:4.5.13

agent/exporter/gradle/dependency-locks/compileClasspath.lockfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This is a Gradle generated file for dependency locking.
22
# Manual edits can break the build and are not advised.
33
# This file is expected to be part of source control.
4+
com.github.oshi:oshi-core:5.6.0
45
com.google.code.findbugs:jsr305:3.0.2
56
com.google.code.gson:gson:2.8.2
67
com.google.errorprone:error_prone_annotations:2.2.0
@@ -22,10 +23,12 @@ io.opentelemetry:opentelemetry-sdk-common:1.0.0
2223
io.opentelemetry:opentelemetry-sdk-trace:1.0.0
2324
io.opentelemetry:opentelemetry-sdk:1.0.0
2425
io.opentelemetry:opentelemetry-semconv:1.0.1-alpha
26+
net.java.dev.jna:jna-platform:5.7.0
27+
net.java.dev.jna:jna:5.7.0
2528
org.apache.commons:commons-lang3:3.11
2629
org.apache.commons:commons-text:1.9
2730
org.apache.httpcomponents:httpclient:4.5.13
2831
org.apache.httpcomponents:httpcore:4.4.13
2932
org.checkerframework:checker-compat-qual:2.5.2
3033
org.codehaus.mojo:animal-sniffer-annotations:1.17
31-
org.slf4j:slf4j-api:1.7.26
34+
org.slf4j:slf4j-api:1.7.30

agent/exporter/gradle/dependency-locks/runtimeClasspath.lockfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This is a Gradle generated file for dependency locking.
22
# Manual edits can break the build and are not advised.
33
# This file is expected to be part of source control.
4+
com.github.oshi:oshi-core:5.6.0
45
com.google.code.findbugs:jsr305:3.0.2
56
com.google.code.gson:gson:2.8.2
67
com.google.errorprone:error_prone_annotations:2.2.0
@@ -21,10 +22,12 @@ io.opentelemetry:opentelemetry-sdk-common:1.0.0
2122
io.opentelemetry:opentelemetry-sdk-trace:1.0.0
2223
io.opentelemetry:opentelemetry-sdk:1.0.0
2324
io.opentelemetry:opentelemetry-semconv:1.0.0-alpha
25+
net.java.dev.jna:jna-platform:5.7.0
26+
net.java.dev.jna:jna:5.7.0
2427
org.apache.commons:commons-lang3:3.11
2528
org.apache.commons:commons-text:1.9
2629
org.apache.httpcomponents:httpclient:4.5.13
2730
org.apache.httpcomponents:httpcore:4.4.13
2831
org.checkerframework:checker-compat-qual:2.5.2
2932
org.codehaus.mojo:animal-sniffer-annotations:1.17
30-
org.slf4j:slf4j-api:1.7.26
33+
org.slf4j:slf4j-api:1.7.30

agent/instrumentation/gradle/dependency-locks/compileClasspath.lockfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This is a Gradle generated file for dependency locking.
22
# Manual edits can break the build and are not advised.
33
# This file is expected to be part of source control.
4+
com.github.oshi:oshi-core:5.6.0
45
com.google.code.findbugs:jsr305:3.0.2
56
com.google.code.gson:gson:2.8.2
67
com.google.errorprone:error_prone_annotations:2.2.0
@@ -85,6 +86,8 @@ io.opentelemetry:opentelemetry-sdk-trace:1.0.0
8586
io.opentelemetry:opentelemetry-sdk:1.0.0
8687
io.opentelemetry:opentelemetry-semconv:1.0.1-alpha
8788
net.bytebuddy:byte-buddy:1.10.10
89+
net.java.dev.jna:jna-platform:5.7.0
90+
net.java.dev.jna:jna:5.7.0
8891
org.apache.commons:commons-lang3:3.11
8992
org.apache.commons:commons-text:1.9
9093
org.apache.httpcomponents:httpclient:4.5.13

agent/instrumentation/gradle/dependency-locks/runtimeClasspath.lockfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Manual edits can break the build and are not advised.
33
# This file is expected to be part of source control.
44
com.blogspot.mydailyjava:weak-lock-free:0.15
5+
com.github.oshi:oshi-core:5.6.0
56
com.google.auto.service:auto-service-annotations:1.0-rc7
67
com.google.auto.service:auto-service:1.0-rc7
78
com.google.auto:auto-common:0.10
@@ -104,6 +105,8 @@ io.prometheus:simpleclient_common:0.9.0
104105
io.prometheus:simpleclient_httpserver:0.9.0
105106
net.bytebuddy:byte-buddy-agent:1.10.18
106107
net.bytebuddy:byte-buddy:1.10.18
108+
net.java.dev.jna:jna-platform:5.7.0
109+
net.java.dev.jna:jna:5.7.0
107110
org.apache.commons:commons-lang3:3.11
108111
org.apache.commons:commons-text:1.9
109112
org.apache.httpcomponents:httpclient:4.5.13

0 commit comments

Comments
 (0)