sudo apt-get install apache2-utils
ab -n 10 -c 2 http://dummy.restapiexample.com/api/v1/employees
import asyncio | |
from contextlib import contextmanager | |
from motor import motor_asyncio | |
import time | |
_times = [] | |
_results = [] | |
@contextmanager |
import com.google.protobuf.DescriptorProtos; | |
import com.google.protobuf.Descriptors; | |
import com.google.protobuf.DynamicMessage; | |
import com.google.protobuf.Message; | |
import java.util.HashMap; | |
/** | |
* ProtobufEnvelope - allows creating a protobuf message without the .proto file dynamically. | |
* |
// alert if scheduler is down. | |
stream | |
|from() | |
.measurement('prefix_scheduler_heartbeat') | |
|deadman(0.0, 5m) | |
.id('AirflowSchedulerDown') | |
.message('Airflow Scheduler is down') | |
.log('/tmp/alert_logs.txt') | |
.trigger_alert_method() |
SELECT | |
sum("mean") | |
FROM | |
"monthly"."airflow_dag_duration" | |
WHERE | |
"dag_id" =~ /^$dag_id$/ | |
AND $timeFilter | |
GROUP BY | |
time($group_interval), "task_id" | |
fill(none) |
> select * from rp.airflow_dag_duration limit 10; | |
name: airflow_dag_duration | |
time count dag_id host lower mean metric_type stddev sum task_id upper | |
---- ----- ------ ---- ----- ---- ----------- ------ --- ------- ----- | |
1587729270000000000 1 sample_dag_name airflow_hostname 1116.553268 1116.553268 timing 0 1116.553268 export_a_table 1116.553268 | |
1587729320000000000 1 sample_dag_name airflow_hostname 423.067092 423.067092 timing 0 423.067092 export_a_temp_table 423.067092 | |
1587729820000000000 1 sample_dag_name airflow_hostname 181.609373 181.609373 timing 0 181.609373 create_summary 181.609373 | |
1587729830000000000 1 sample_dag_name airflow_hostname 1.416052 1.416052 timing 0 1.416052 delete_table 1.416052 | |
1587729830000000000 1 sample_dag_name airflow_hostname 2.528059 2.528059 timing |
[ | |
"*.dag.*.*.duration measurement.measurement.dag_id.task_id.measurement", | |
"*.dagrun.dependency-check.* measurement.measurement.measurement.dag_id", | |
"*.dag_processing.last_duration.* measurement.measurement.measurement.dag_id", | |
"*.dagrun.duration.*.* measurement.measurement.measurement.status.dag_id", | |
"*.dagrun.schedule_delay.* measurement.measurement.measurement.dag_id", | |
"*.dag_processing.last_runtime.* measurement.measurement.measurement.dag_id", | |
"*.dag.loading-duration.* measurement.measurement.measurement.dag_id", | |
"*.operator.*.* measurement.measurement.status.operator" | |
] |
$("head").append(`<style> | |
body, | |
body.notebook_app.command_mode { | |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif; | |
} | |
.CodeMirror pre, | |
.CodeMirror-dialog, | |
.CodeMirror-dialog .CodeMirror-search-field, | |
.terminal-app .terminal { |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |