Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 450ed3e8 authored by Bertrand Simonnet's avatar Bertrand Simonnet Committed by Android Git Automerger
Browse files

am eeab5cd5: Merge "metricsd: Remove unused Chrome OS specific files."

* commit 'eeab5cd5':
  metricsd: Remove unused Chrome OS specific files.
parents d26681c0 eeab5cd5
Loading
Loading
Loading
Loading

metricsd/init/metrics_daemon.conf

deleted100644 → 0
+0 −18
Original line number Diff line number Diff line
# 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}
+0 −25
Original line number Diff line number Diff line
# 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

metricsd/make_tests.sh

deleted100755 → 0
+0 −12
Original line number Diff line number Diff line
#!/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}"

metricsd/platform2_preinstall.sh

deleted100755 → 0
+0 −13
Original line number Diff line number Diff line
#!/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

metricsd/syslog_parser.sh

deleted100755 → 0
+0 −69
Original line number Diff line number Diff line
#! /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