am eeab5cd5: Merge "metricsd: Remove unused Chrome OS specific files."
* commit 'eeab5cd585ccaef9d1d0e766bf7c36c661421b9a': metricsd: Remove unused Chrome OS specific files.
This commit is contained in:
commit
450ed3e8c0
|
@ -1,18 +0,0 @@
|
|||
# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
description "Metrics collection daemon"
|
||||
author "chromium-os-dev@chromium.org"
|
||||
|
||||
# The metrics daemon is responsible for receiving and forwarding to
|
||||
# chrome UMA statistics not produced by chrome.
|
||||
start on starting system-services
|
||||
stop on stopping system-services
|
||||
respawn
|
||||
|
||||
# metrics will update the next line to add -uploader for embedded builds.
|
||||
env DAEMON_FLAGS=""
|
||||
|
||||
expect fork
|
||||
exec metrics_daemon ${DAEMON_FLAGS}
|
|
@ -1,25 +0,0 @@
|
|||
# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
description "Metrics Library upstart file"
|
||||
author "chromium-os-dev@chromium.org"
|
||||
|
||||
# The metrics library is used by several programs (daemons and others)
|
||||
# to send UMA stats.
|
||||
start on starting boot-services
|
||||
|
||||
pre-start script
|
||||
# Create the file used as communication endpoint for metrics.
|
||||
METRICS_DIR=/var/lib/metrics
|
||||
EVENTS_FILE=${METRICS_DIR}/uma-events
|
||||
mkdir -p ${METRICS_DIR}
|
||||
touch ${EVENTS_FILE}
|
||||
chown chronos.chronos ${EVENTS_FILE}
|
||||
chmod 666 ${EVENTS_FILE}
|
||||
# TRANSITION ONLY.
|
||||
# TODO(semenzato) Remove after Chrome change, see issue 447256.
|
||||
# Let Chrome read the metrics file from the old location.
|
||||
mkdir -p /var/run/metrics
|
||||
ln -sf ${EVENTS_FILE} /var/run/metrics
|
||||
end script
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# Builds tests.
|
||||
|
||||
set -e
|
||||
make tests
|
||||
mkdir -p "${OUT_DIR}"
|
||||
cp *_test "${OUT_DIR}"
|
|
@ -1,13 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
set -e
|
||||
|
||||
OUT=$1
|
||||
shift
|
||||
for v; do
|
||||
sed -e "s/@BSLOT@/${v}/g" libmetrics.pc.in > "${OUT}/lib/libmetrics-${v}.pc"
|
||||
done
|
|
@ -1,69 +0,0 @@
|
|||
#! /bin/sh
|
||||
|
||||
# This script parses /var/log/syslog for messages from programs that log
|
||||
# uptime and disk stats (number of sectors read). It then outputs
|
||||
# these stats in a format usable by the metrics collector, which forwards
|
||||
# them to autotest and UMA.
|
||||
|
||||
# To add a new metric add a line below, as PROGRAM_NAME METRIC_NAME.
|
||||
# PROGRAM_NAME is the name of the job whose start time we
|
||||
# are interested in. METRIC_NAME is the prefix we want to use for
|
||||
# reporting to UMA and autotest. The script prepends "Time" and
|
||||
# "Sectors" to METRIC_NAME for the two available measurements, uptime
|
||||
# and number of sectors read thus far.
|
||||
|
||||
# You will need to emit messages similar to the following in order to add a
|
||||
# a metric using this process. You will need to emit both a start and stop
|
||||
# time and the metric reported will be the difference in values
|
||||
|
||||
# Nov 15 08:05 localhost PROGRAM_NAME[822]: start METRIC_NAME time 12 sectors 56
|
||||
# Nov 15 08:05 localhost PROGRAM_NAME[822]: stop METRIC_NAME time 24 sectors 68
|
||||
|
||||
# If you add metrics without a start, it is assumed you are requesting the
|
||||
# time differece from system start
|
||||
|
||||
# Metrics we are interested in measuring
|
||||
METRICS="
|
||||
upstart start_x
|
||||
"
|
||||
|
||||
first=1
|
||||
program=""
|
||||
|
||||
# Get the metrics for all things
|
||||
for m in $METRICS
|
||||
do
|
||||
if [ $first -eq 1 ]
|
||||
then
|
||||
first=0
|
||||
program_name=$m
|
||||
else
|
||||
first=1
|
||||
metrics_name=$m
|
||||
|
||||
# Example of line from /var/log/messages:
|
||||
# Nov 15 08:05:42 localhost connmand[822]: start metric time 12 sectors 56
|
||||
# "upstart:" is $5, 1234 is $9, etc.
|
||||
program="${program}/$program_name([[0-9]+]:|:) start $metrics_name/\
|
||||
{
|
||||
metrics_start[\"${metrics_name}Time\"] = \$9;
|
||||
metrics_start[\"${metrics_name}Sectors\"] = \$11;
|
||||
}"
|
||||
program="${program}/$program_name([[0-9]+]:|:) stop $metrics_name/\
|
||||
{
|
||||
metrics_stop[\"${metrics_name}Time\"] = \$9;
|
||||
metrics_stop[\"${metrics_name}Sectors\"] = \$11;
|
||||
}"
|
||||
fi
|
||||
done
|
||||
|
||||
# Do all the differencing here
|
||||
program="${program}\
|
||||
END{
|
||||
for (i in metrics_stop) {
|
||||
value_time = metrics_stop[i] - metrics_start[i];
|
||||
print i \"=\" value_time;
|
||||
}
|
||||
}"
|
||||
|
||||
exec awk "$program" /var/log/syslog
|
Loading…
Reference in New Issue