blob: 920cfe8f1b9531b705fee70b25d6a4c76f13c136 [file] [log] [blame]
# Copyright 2020 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 "Chromium OS cryptohome D-Bus performance test service."
author "chromium-os-dev@chromium.org"
start on starting cryptohomed
stop on stopping cryptohomed
oom score -100
env RESULT_FOLDER_PATH="/tmp"
script
execution_time() {
local start_time=$(date +%s%N)
$@ >/dev/null 2>/dev/null
echo $((`date +%s%N` - $start_time))
}
execution_time /usr/bin/gdbus wait --system org.chromium.Cryptohome \
> $RESULT_FOLDER_PATH/cryptohome_dbus_time &
if /usr/libexec/cryptohome/shall-use-userdataauth.sh; then
# New interface is used.
execution_time /usr/bin/gdbus wait --system org.chromium.UserDataAuth \
> $RESULT_FOLDER_PATH/userdataauth_dbus_time &
fi
wait
end script