1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-07 03:11:53 +01:00
workload-automation/wlauto/workloads/androbench/__init__.py

44 lines
1.7 KiB
Python
Raw Normal View History

# Copyright 2013-2015 ARM Limited
#
# 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.
#
import os
import sqlite3
from wlauto import AndroidUiAutoBenchmark
2015-08-17 20:39:45 +01:00
class Androbench(AndroidUiAutoBenchmark):
name = 'androbench'
description = """Androbench measures the storage performance of device"""
package = 'com.andromeda.androbench2'
activity = '.main'
run_timeout = 10 * 60
def update_result(self, context):
super(Androbench, self).update_result(context)
dbn = 'databases/history.db'
db = self.device.path.join(self.device.package_data_directory, self.package, dbn)
host_results = os.path.join(context.output_directory, 'history.db')
self.device.pull_file(db, host_results, as_root=True)
2015-08-17 20:39:45 +01:00
qs = 'select * from history'
conn = sqlite3.connect(host_results)
c = conn.cursor()
c.execute(qs)
results = c.fetchone()
context.result.add_metric('Sequential Read ', results[8], 'MB/s')
2015-08-17 20:39:45 +01:00
context.result.add_metric('Sequential Write ', results[9], 'MB/s')
context.result.add_metric('Random Read ', results[10], 'MB/s')
context.result.add_metric('Random Write ', results[12], 'MB/s')