5a6bfca163
Now that we're offering to store private app data on adopted storage devices, the performance of those devices is much more important to overall user experience. To help set user expectations, this change offers to execute a real-world benchmark on a storage device, returning a metric that can be used to compare internal and external storage. The benchmark is generated from the strace-instrumented storage access patterns of typical apps. A typical device completes the benchmark in under two seconds on internal storage, a UHS-3 SD card is even faster (!), but a very slow Class 4 SD card takes about 30 seconds to complete, giving us a clear signal. The measured benchmark numbers are logged along with information about the storage device, such as manufacturer, model, etc. Card serial numbers are scrubbed from output. Bug: 21172095 Change-Id: I9b2713dafdfdfcf5d97bf1bc21841f39409a7e54
33 lines
924 B
C++
33 lines
924 B
C++
/*
|
|
* Copyright (C) 2015 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#ifndef ANDROID_VOLD_BENCHMARK_H
|
|
#define ANDROID_VOLD_BENCHMARK_H
|
|
|
|
#include <utils/Errors.h>
|
|
#include <utils/Timers.h>
|
|
|
|
#include <string>
|
|
|
|
namespace android {
|
|
namespace vold {
|
|
|
|
nsecs_t Benchmark(const std::string& path, const std::string& sysPath);
|
|
|
|
} // namespace vold
|
|
} // namespace android
|
|
|
|
#endif
|