Skip to content

Commit

Permalink
Add Fallback log entry
Browse files Browse the repository at this point in the history
  • Loading branch information
geo2a committed Sep 14, 2023
1 parent 929ecc3 commit 033fad6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions kore-rpc-types/src/Kore/JsonRpc/Types/Log.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
module Kore.JsonRpc.Types.Log (module Kore.JsonRpc.Types.Log) where

import Data.Aeson (FromJSON, ToJSON)
import Data.List.NonEmpty (NonEmpty)
import Data.Text (Text)
import GHC.Generics (Generic)
import Kore.JsonRpc.Types.Depth (Depth (..))
import Kore.Syntax.Json.Types (KoreJson)

import Deriving.Aeson (
Expand Down Expand Up @@ -56,6 +58,21 @@ data LogEntry
, result :: LogRewriteResult
, origin :: LogOrigin
}
| -- | Indicates a fallback of an RPC-server to a more powerful, but slower backup server, i.e. Booster to Kore
Fallback
{ originalTerm :: Maybe KoreJson
-- ^ state before fallback
, rewrittenTerm :: Maybe KoreJson
-- ^ state after fallback
, reason :: Text
-- ^ fallback reason
, ruleIds :: NonEmpty Text
-- ^ rules applied during fallback, the first rule is the one that caused the fallback
, recoveryDepth :: Depth
-- ^ depth reached in fallback, must be the same as (length ruleIds)
, origin :: LogOrigin
-- ^ proxi server the log was emitted from
}
deriving stock (Generic, Show, Eq)
deriving
(FromJSON, ToJSON)
Expand Down

0 comments on commit 033fad6

Please sign in to comment.