1. Stefan Saasen
  2. stash-log-parser

Commits

Stefan Saasen  committed 8cc5f42

Analyser: Remove unused maxConcurrent function

  • Participants
  • Parent commits e9d0569
  • Branches master

Comments (0)

Files changed (2)

File logparser/src/Stash/Log/Analyser.hs

View file
 , Input
 , ProtocolStats(..)
 , DateValuePair(..)
-, maxConcurrent
 , concurrentConnections
 , protocolStatsByHour
 , showLines
 
 -- | Count the number of lines marked as incoming (aka request)
 countRequestLines :: Input -> Integer
-countRequestLines = countLinesWith (\x acc -> let rid = getRequestId x
-                                              in if isIncoming rid then acc + 1 else acc)
+countRequestLines = countLinesWith (\x acc -> if isIncoming $ getRequestId x then succ acc else acc)
 
-maxConcurrent:: Input -> Integer
-maxConcurrent = countLinesWith (\x acc -> let conn = getConcurrentRequests $ getRequestId x
-                                          in if conn >= acc then conn else acc)
 
 -- The concurrent connection data needs to be aggregated.
 -- Example

File logparser/tests/Properties.hs

View file
     ]
     (concurrentConnections dataLogLines)
 
--- | Test maxConcurrent
-test_maxConcurrent = H.assertEqual
-    "Should return the correct number of concurrent requests"
-    10
-    (maxConcurrent dataLogLines)
-
 test_protocolCount = H.assertEqual
     "Should count the protocol correctly"
     (sort [("https", 3), ("ssh", 1)])
 tests =
     [ testGroup "analyser"
       [ --testProperty "analyser/countLines" prop_countLines
-        testCase "analyser/maxConcurrent" test_maxConcurrent
-        ,testCase "analyser/protocolCount" test_protocolCount
+         testCase "analyser/protocolCount" test_protocolCount
         ,testCase "analyser/dataConcurrentConn logDateEqHour" test_concurrentConnections
         ,testCase "analyser/isRefAdvertisement ssh" test_identifyRefAdvertisement_SSH
         ,testCase "analyser/isRefAdvertisement ignore incoming ssh" test_identifyRefAdvertisement_SSHIncoming