-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
68 additions
and
31 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
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,19 +1,52 @@ | ||
defmodule Sidecar.Measurements do | ||
@moduledoc false | ||
|
||
def dispatch_system_info() do | ||
def stats() do | ||
otp_release = :erlang.system_info(:otp_release) | ||
multi_scheduling = :erlang.system_info(:multi_scheduling) | ||
threads = :erlang.system_info(:threads) | ||
smp_support = :erlang.system_info(:smp_support) | ||
|
||
dirty_cpu_schedulers = :erlang.system_info(:dirty_cpu_schedulers) | ||
dirty_cpu_schedulers_online = :erlang.system_info(:dirty_cpu_schedulers_online) | ||
dist_buf_busy_limit = :erlang.system_info(:dist_buf_busy_limit) | ||
process_count = :erlang.system_info(:process_count) | ||
schedulers = :erlang.system_info(:schedulers) | ||
schedulers_online = :erlang.system_info(:schedulers_online) | ||
thread_pool_size = :erlang.system_info(:thread_pool_size) | ||
|
||
:telemetry.execute( | ||
[:vm, :system_info, :process_count], | ||
%{last_value: :erlang.system_info(:process_count)}, | ||
%{} | ||
[:vm, :system_info], | ||
%{ | ||
dirty_cpu_schedulers: dirty_cpu_schedulers, | ||
dirty_cpu_schedulers_online: dirty_cpu_schedulers_online, | ||
dist_buf_busy_limit: dist_buf_busy_limit, | ||
process_count: process_count, | ||
schedulers: schedulers, | ||
schedulers_online: schedulers_online, | ||
thread_pool_size: thread_pool_size | ||
}, | ||
%{ | ||
otp_release: otp_release, | ||
smp_support: smp_support, | ||
multi_scheduling: multi_scheduling, | ||
threads: threads | ||
} | ||
) | ||
end | ||
|
||
def emit_invoke_duration(system, actor_name, duration) do | ||
:telemetry.execute([:spawn, :invoke, :stop], %{system: system, actor: actor_name, duration: duration}) | ||
def dispatch_invoke_duration(system, actor_name, action, duration) do | ||
:telemetry.execute( | ||
[:spawn, :invoke, :stop], | ||
%{duration: duration}, | ||
%{system: system, name: actor_name, action: action} | ||
) | ||
end | ||
|
||
def emit_actor_inflights(system, actor_name, value) do | ||
:telemetry.execute([:spawn, :actor, :inflights], %{value: value}, %{system: system, actor: actor_name}) | ||
def dispatch_actor_inflights(system, actor_name, value) do | ||
:telemetry.execute([:spawn, :actor, :inflight_messages], %{messages: value}, %{ | ||
system: system, | ||
name: actor_name | ||
}) | ||
end | ||
end |
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