simplify the name of the test cases

This commit is contained in:
Joey Hess 2019-11-21 17:38:58 -04:00
parent a9888f6151
commit 92e1bb250b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 7 additions and 7 deletions

View file

@ -13,7 +13,7 @@ git-annex (7.20191115) UNRELEASED; urgency=medium
* benchmark: Changed --databases to take a parameter specifiying the size * benchmark: Changed --databases to take a parameter specifiying the size
of the database to benchmark. of the database to benchmark.
* benchmark --databases: Display size of the populated database. * benchmark --databases: Display size of the populated database.
* benchmark --databases: Improve the "addAssociatedFile to (new)" * benchmark --databases: Improve the "addAssociatedFile (new)"
benchmark to really add new values, not overwriting old values. benchmark to really add new values, not overwriting old values.
* Windows: Fix handling of changes to time zone. (Used to work but was * Windows: Fix handling of changes to time zone. (Used to work but was
broken in version 7.20181031.) broken in version 7.20181031.)

View file

@ -49,33 +49,33 @@ benchmarkDbs _ = error "not built with criterion, cannot benchmark"
#ifdef WITH_BENCHMARK #ifdef WITH_BENCHMARK
getAssociatedFilesHitBench :: BenchDb -> Benchmark getAssociatedFilesHitBench :: BenchDb -> Benchmark
getAssociatedFilesHitBench (BenchDb h num) = bench ("getAssociatedFiles from " ++ show num ++ " (hit)") $ nfIO $ do getAssociatedFilesHitBench (BenchDb h num) = bench ("getAssociatedFiles (hit)") $ nfIO $ do
n <- getStdRandom (randomR (1,num)) n <- getStdRandom (randomR (1,num))
SQL.getAssociatedFiles (toIKey (keyN n)) (SQL.ReadHandle h) SQL.getAssociatedFiles (toIKey (keyN n)) (SQL.ReadHandle h)
getAssociatedFilesMissBench :: BenchDb -> Benchmark getAssociatedFilesMissBench :: BenchDb -> Benchmark
getAssociatedFilesMissBench (BenchDb h num) = bench ("getAssociatedFiles from " ++ show num ++ " (miss)") $ nfIO $ getAssociatedFilesMissBench (BenchDb h _num) = bench ("getAssociatedFiles (miss)") $ nfIO $
SQL.getAssociatedFiles (toIKey keyMiss) (SQL.ReadHandle h) SQL.getAssociatedFiles (toIKey keyMiss) (SQL.ReadHandle h)
getAssociatedKeyHitBench :: BenchDb -> Benchmark getAssociatedKeyHitBench :: BenchDb -> Benchmark
getAssociatedKeyHitBench (BenchDb h num) = bench ("getAssociatedKey from " ++ show num ++ " (hit)") $ nfIO $ do getAssociatedKeyHitBench (BenchDb h num) = bench ("getAssociatedKey (hit)") $ nfIO $ do
n <- getStdRandom (randomR (1,num)) n <- getStdRandom (randomR (1,num))
-- fromIKey because this ends up being used to get a Key -- fromIKey because this ends up being used to get a Key
map fromIKey <$> SQL.getAssociatedKey (fileN n) (SQL.ReadHandle h) map fromIKey <$> SQL.getAssociatedKey (fileN n) (SQL.ReadHandle h)
getAssociatedKeyMissBench :: BenchDb -> Benchmark getAssociatedKeyMissBench :: BenchDb -> Benchmark
getAssociatedKeyMissBench (BenchDb h num) = bench ("getAssociatedKey from " ++ show num ++ " (miss)") $ nfIO $ getAssociatedKeyMissBench (BenchDb h _num) = bench ("getAssociatedKey from (miss)") $ nfIO $
-- fromIKey because this ends up being used to get a Key -- fromIKey because this ends up being used to get a Key
map fromIKey <$> SQL.getAssociatedKey fileMiss (SQL.ReadHandle h) map fromIKey <$> SQL.getAssociatedKey fileMiss (SQL.ReadHandle h)
addAssociatedFileOldBench :: BenchDb -> Benchmark addAssociatedFileOldBench :: BenchDb -> Benchmark
addAssociatedFileOldBench (BenchDb h num) = bench ("addAssociatedFile to " ++ show num ++ " (old)") $ nfIO $ do addAssociatedFileOldBench (BenchDb h num) = bench ("addAssociatedFile to (old)") $ nfIO $ do
n <- getStdRandom (randomR (1,num)) n <- getStdRandom (randomR (1,num))
SQL.addAssociatedFile (toIKey (keyN n)) (fileN n) (SQL.WriteHandle h) SQL.addAssociatedFile (toIKey (keyN n)) (fileN n) (SQL.WriteHandle h)
H.flushDbQueue h H.flushDbQueue h
addAssociatedFileNewBench :: BenchDb -> Benchmark addAssociatedFileNewBench :: BenchDb -> Benchmark
addAssociatedFileNewBench (BenchDb h num) = bench ("addAssociatedFile to " ++ show num ++ " (new)") $ nfIO $ do addAssociatedFileNewBench (BenchDb h num) = bench ("addAssociatedFile to (new)") $ nfIO $ do
n <- getStdRandom (randomR (1,num)) n <- getStdRandom (randomR (1,num))
SQL.addAssociatedFile (toIKey (keyN n)) (fileN (num+n)) (SQL.WriteHandle h) SQL.addAssociatedFile (toIKey (keyN n)) (fileN (num+n)) (SQL.WriteHandle h)
H.flushDbQueue h H.flushDbQueue h