| # Copyright 2017 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 "Report recovery metrics to UMA" |
| author "chromium-os-dev@chromium.org" |
| |
| start on started system-services |
| |
| script |
| # Recovery histograms file is written by chromeos-install during recovery. |
| RECOVERY_HISTOGRAMS="/mnt/stateful_partition/.recovery_histograms" |
| if [ -f "${RECOVERY_HISTOGRAMS}" ]; then |
| # Send one sample per line, formatted as: "<name> <sample> <max>\n" |
| while IFS=' ' read -r name sample max; do |
| metrics_client -e "${name}" "${sample}" "${max}" |
| done < "${RECOVERY_HISTOGRAMS}" |
| |
| # Remove recovery histograms file so we don't report this recovery again. |
| rm -f "${RECOVERY_HISTOGRAMS}" |
| fi |
| end script |