@@ -82,28 +82,21 @@ data HostDeduction
82
82
---
83
83
--- Files
84
84
---
85
- newtype JsonGenesisFile
86
- = JsonGenesisFile { unJsonGenesisFile :: FilePath }
87
- deriving (Show , Eq )
88
-
89
- newtype JsonRunMetafile
90
- = JsonRunMetafile { unJsonRunMetafile :: FilePath }
91
- deriving (Show , Eq )
92
-
93
- newtype JsonDomainFile
94
- = JsonDomainFile { unJsonDomainFile :: FilePath }
85
+ newtype InputDir
86
+ = InputDir { unInputDir :: FilePath }
95
87
deriving (Show , Eq )
88
+ deriving newtype (NFData )
96
89
97
90
newtype JsonLogfile
98
91
= JsonLogfile { unJsonLogfile :: FilePath }
99
92
deriving (Show , Eq )
100
93
deriving newtype (NFData )
101
94
102
- newtype JsonInputFile
95
+ newtype JsonInputFile ( a :: Type )
103
96
= JsonInputFile { unJsonInputFile :: FilePath }
104
97
deriving (Show , Eq )
105
98
106
- newtype JsonOutputFile
99
+ newtype JsonOutputFile ( a :: Type )
107
100
= JsonOutputFile { unJsonOutputFile :: FilePath }
108
101
deriving (Show , Eq )
109
102
@@ -115,6 +108,10 @@ newtype OrgOutputFile
115
108
= OrgOutputFile { unOrgOutputFile :: FilePath }
116
109
deriving (Show , Eq )
117
110
111
+ newtype TextInputFile
112
+ = TextInputFile { unTextInputFile :: FilePath }
113
+ deriving (Show , Eq )
114
+
118
115
newtype TextOutputFile
119
116
= TextOutputFile { unTextOutputFile :: FilePath }
120
117
deriving (Show , Eq )
@@ -127,59 +124,15 @@ newtype OutputFile
127
124
= OutputFile { unOutputFile :: FilePath }
128
125
deriving (Show , Eq )
129
126
130
- data MachineTimelineOutputFiles
131
- = MachineTimelineOutputFiles
132
- { mtofSlotStats :: Maybe JsonOutputFile
133
- , mtofAnalysis :: Maybe JsonOutputFile
134
- , mtofFullStatsPretty :: Maybe TextOutputFile
135
- , mtofReportStatsPretty :: Maybe TextOutputFile
136
- , mtofTimelinePretty :: Maybe TextOutputFile
137
- , mtofTimelineCsv :: Maybe CsvOutputFile
138
- , mtofFullStatsCsv :: Maybe CsvOutputFile
139
- , mtofDerivedVectors0Csv :: Maybe CsvOutputFile
140
- , mtofDerivedVectors1Csv :: Maybe CsvOutputFile
141
- }
142
- deriving (Show )
143
-
144
- data BlockPropOutputFiles
145
- = BlockPropOutputFiles
146
- { bpofForgerPretty :: Maybe TextOutputFile
147
- , bpofPeersPretty :: Maybe TextOutputFile
148
- , bpofPropagationPretty :: Maybe TextOutputFile
149
- , bpofFullStatsPretty :: Maybe TextOutputFile
150
- , bpofMachViews :: Maybe JsonOutputFile
151
- , bpofChainPretty :: Maybe TextOutputFile
152
- , bpofChain :: Maybe JsonOutputFile
153
- , bpofChainRaw :: Maybe JsonOutputFile
154
- , bpofAnalysis :: Maybe JsonOutputFile
155
- }
156
- deriving (Show )
157
-
158
127
---
159
128
--- Parsers
160
129
---
161
- optJsonGenesisFile :: String -> String -> Parser JsonGenesisFile
162
- optJsonGenesisFile optname desc =
163
- fmap JsonGenesisFile $
130
+ optInputDir :: String -> String -> Parser InputDir
131
+ optInputDir optname desc =
132
+ fmap InputDir $
164
133
Opt. option Opt. str
165
134
$ long optname
166
- <> metavar " GENESIS-FILE"
167
- <> help desc
168
-
169
- optJsonRunMetafile :: String -> String -> Parser JsonRunMetafile
170
- optJsonRunMetafile optname desc =
171
- fmap JsonRunMetafile $
172
- Opt. option Opt. str
173
- $ long optname
174
- <> metavar " RUN-METAFILE"
175
- <> help desc
176
-
177
- optJsonDomainFile :: String -> String -> Parser JsonDomainFile
178
- optJsonDomainFile optname desc =
179
- fmap JsonDomainFile $
180
- Opt. option Opt. str
181
- $ long optname
182
- <> metavar " DOMAINFILE"
135
+ <> metavar " DIR"
183
136
<> help desc
184
137
185
138
optJsonLogfile :: String -> String -> Parser JsonLogfile
@@ -195,15 +148,15 @@ argJsonLogfile =
195
148
JsonLogfile <$>
196
149
Opt. argument Opt. str (Opt. metavar " LOGFILE" )
197
150
198
- optJsonInputFile :: String -> String -> Parser JsonInputFile
151
+ optJsonInputFile :: String -> String -> Parser ( JsonInputFile a )
199
152
optJsonInputFile optname desc =
200
153
fmap JsonInputFile $
201
154
Opt. option Opt. str
202
155
$ long optname
203
156
<> metavar " JSON-FILE"
204
157
<> help desc
205
158
206
- optJsonOutputFile :: String -> String -> Parser JsonOutputFile
159
+ optJsonOutputFile :: String -> String -> Parser ( JsonOutputFile a )
207
160
optJsonOutputFile optname desc =
208
161
fmap JsonOutputFile $
209
162
Opt. option Opt. str
@@ -219,6 +172,14 @@ optGnuplotOutputFile optname desc =
219
172
<> metavar " CDF-OUTFILE"
220
173
<> help desc
221
174
175
+ optTextInputFile :: String -> String -> Parser TextInputFile
176
+ optTextInputFile optname desc =
177
+ fmap TextInputFile $
178
+ Opt. option Opt. str
179
+ $ long optname
180
+ <> metavar " TEXT-INFILE"
181
+ <> help desc
182
+
222
183
optTextOutputFile :: String -> String -> Parser TextOutputFile
223
184
optTextOutputFile optname desc =
224
185
fmap TextOutputFile $
@@ -279,56 +240,3 @@ optWord optname desc def =
279
240
<> metavar " INT"
280
241
<> help desc
281
242
<> value def
282
-
283
- parseMachineTimelineOutputFiles :: Parser MachineTimelineOutputFiles
284
- parseMachineTimelineOutputFiles =
285
- MachineTimelineOutputFiles
286
- <$> optional
287
- (optJsonOutputFile " slotstats-json"
288
- " Per-slot performance summaries" )
289
- <*> optional
290
- (optJsonOutputFile " analysis-json"
291
- " Write analysis JSON to this file, if specified -- otherwise print to stdout." )
292
- <*> optional
293
- (optTextOutputFile " fullstats-text"
294
- " Full performance statistics breakdown" )
295
- <*> optional
296
- (optTextOutputFile " reportstats-text"
297
- " Report performance statistics breakdown" )
298
- <*> optional
299
- (optTextOutputFile " timeline-text"
300
- " Dump pretty timeline of extracted slot leadership summaries, as a side-effect of log analysis" )
301
- <*> optional
302
- (optCsvOutputFile " timeline-csv"
303
- " Dump CSV of the timeline" )
304
- <*> optional
305
- (optCsvOutputFile " stats-csv"
306
- " Dump CSV of the timeline statistics" )
307
- <*> optional
308
- (optCsvOutputFile " derived-vectors-0-csv"
309
- " Dump CSV of vectors derived from the timeline" )
310
- <*> optional
311
- (optCsvOutputFile " derived-vectors-1-csv"
312
- " Dump CSV of vectors derived from the timeline" )
313
-
314
- parseBlockPropOutputFiles :: Parser BlockPropOutputFiles
315
- parseBlockPropOutputFiles =
316
- BlockPropOutputFiles
317
- <$> optional
318
- (optTextOutputFile " forger-text" " Forger stats" )
319
- <*> optional
320
- (optTextOutputFile " peers-text" " Peers stats" )
321
- <*> optional
322
- (optTextOutputFile " propagation-text" " Propagation stats" )
323
- <*> optional
324
- (optTextOutputFile " fullstats-text" " Full (forger+peers+propagation) stats" )
325
- <*> optional
326
- (optJsonOutputFile " mach-views-json" " Machine chain views as JSON" )
327
- <*> optional
328
- (optTextOutputFile " chain-text" " Timeline of chain evolution, one line per block" )
329
- <*> optional
330
- (optJsonOutputFile " chain-raw-json" " Unfiltered chain as JSON" )
331
- <*> optional
332
- (optJsonOutputFile " chain-json" " Chain as JSON" )
333
- <*> optional
334
- (optJsonOutputFile " analysis-json" " Analysis as JSON" )
0 commit comments