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

Commit e3cc5d59 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

[Ravenwood] Add timestamp to stats CSV

Bug: 292141694
Test: ravenwood/scripts/ravenwood-stats-collector.sh
  and check the output file
Change-Id: I4e8e8462248355045e2494aa5e9fd457f85be15a
parent 85c45b20
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ apis=/tmp/ravenwood-apis-all.csv
# Where the input files are.
path=$ANDROID_BUILD_TOP/out/host/linux-x86/testcases/ravenwood-stats-checker/x86_64/

timestamp="$(date --iso-8601=seconds)"

m() {
    ${ANDROID_BUILD_TOP}/build/soong/soong_ui.bash --make-mode "$@"
}
@@ -39,15 +41,15 @@ dump() {
    local jar=$1
    local file=$2

    # Use sed to remove the header + prepend the jar filename.
    sed -e '1d' -e "s/^/$jar,/" $file
    # Remove the header row, and prepend the columns.
    sed -e '1d' -e "s/^/$jar,$timestamp,/" $file
}

collect_stats() {
    local out="$1"
    {
        # Copy the header, with the first column appended.
        echo -n "Jar,"
        echo -n "Jar,Generated Date,"
        head -n 1 hoststubgen_framework-minus-apex_stats.csv

        dump "framework-minus-apex" hoststubgen_framework-minus-apex_stats.csv
@@ -61,7 +63,7 @@ collect_apis() {
    local out="$1"
    {
        # Copy the header, with the first column appended.
        echo -n "Jar,"
        echo -n "Jar,Generated Date,"
        head -n 1 hoststubgen_framework-minus-apex_apis.csv

        dump "framework-minus-apex"  hoststubgen_framework-minus-apex_apis.csv