on master help sign in
Default index sharding to daily
f3738dfMichael Xavier
katip-elasticsearch/src/Katip/Scribes/ElasticSearch.hs+2−2
@@ -101,7 +101,7 @@ data EsScribeCfg = EsScribeCfg {
101--
101--
102-- * Annotate types set to False
102-- * Annotate types set to False
103--
103--
104−-- * NoIndexSharding
104+-- * DailyIndexSharding
105defaultEsScribeCfg :: EsScribeCfg
105defaultEsScribeCfg :: EsScribeCfg
106defaultEsScribeCfg = EsScribeCfg {
106defaultEsScribeCfg = EsScribeCfg {
107 essManagerSettings = defaultManagerSettings
107 essManagerSettings = defaultManagerSettings
@@ -110,7 +110,7 @@ defaultEsScribeCfg = EsScribeCfg {
110 , essPoolSize = EsPoolSize 2
110 , essPoolSize = EsPoolSize 2
111 , essAnnotateTypes = False
111 , essAnnotateTypes = False
112 , essIndexSettings = defaultIndexSettings
112 , essIndexSettings = defaultIndexSettings
113− , essIndexSharding = NoIndexSharding
113+ , essIndexSharding = DailyIndexSharding
114 }
114 }
115
115
116
116
katip-elasticsearch/test/Main.hs+2−2
@@ -78,7 +78,7 @@ withSearch' modScribeCfg = withResource (setupSearch modScribeCfg) teardownSearc
78esTests :: TestTree
78esTests :: TestTree
79esTests = testGroup "elasticsearch scribe"
79esTests = testGroup "elasticsearch scribe"
80 [
80 [
81− withSearch $ \setup -> testCase "it flushes to elasticsearch" $ withTestLogging setup $ \done -> do
81+ withSearch' (\c -> c { essIndexSharding = NoIndexSharding}) $ \setup -> testCase "it flushes to elasticsearch" $ withTestLogging setup $ \done -> do
82 $(logT) (ExampleCtx True) mempty InfoS "A test message"
82 $(logT) (ExampleCtx True) mempty InfoS "A test message"
83 liftIO $ do
83 liftIO $ do
84 void done
84 void done
@@ -87,7 +87,7 @@ esTests = testGroup "elasticsearch scribe"
87 let l = head logs
87 let l = head logs
88 l ^? key "_source" . key "msg" . _String @?= Just "A test message"
88 l ^? key "_source" . key "msg" . _String @?= Just "A test message"
89 l ^? key "_source" . key "data" . key "whatever::b" . _Bool @?= Just True
89 l ^? key "_source" . key "data" . key "whatever::b" . _Bool @?= Just True
90− , withSearch' (\c -> c { essIndexSharding = DailyIndexSharding}) $ \setup -> testCase "date-based index sharding" $ do
90+ , withSearch $ \setup -> testCase "date-based index sharding" $ do
91 let t1 = mkTime 2016 1 2 3 4 5
91 let t1 = mkTime 2016 1 2 3 4 5
92 fakeClock <- newTVarIO t1
92 fakeClock <- newTVarIO t1
93 withTestLogging' (set logEnvTimer (readTVarIO fakeClock)) setup $ \done -> do
93 withTestLogging' (set logEnvTimer (readTVarIO fakeClock)) setup $ \done -> do