Documentation ¶
Index ¶
- Constants
- Variables
- func ComputePerTo(results []ResultFile) map[string][2]map[uint64][]ResultFile
- func ComputePerToAllTypes(results []ResultFile) (ret [2]map[uint64][]ResultFile)
- func ComputePerToAllTypesProfile(results []CPUProfileResult) (ret map[uint64][]CPUProfileResult)
- func ComputePerToPerNodeCount(results []ResultFile) map[int]map[string][2]map[uint64][]ResultFile
- func ComputePerToPerNodeCountProfile(results []CPUProfileResult) map[int]map[string]map[uint64][]CPUProfileResult
- func ComputePerToProfile(results []CPUProfileResult) map[string]map[uint64][]CPUProfileResult
- func GenGraph(title, xLabel, yLabel, folderPath string, extraNames []VaryField, ...) (multiPlotStrings [][]string, err error)
- func GenGraphByGenSet(folderPath string, genSet GenSet, allResults []ResultFile)
- func GenMultiPlot(idx int, folderPath, gnuPlotFile string, properties []GraphProperties, ...) error
- func GenProfileGraph(title, xLabel, yLabel string, numFields int, folderPath string, ...) error
- func GenResults(folderPath string) error
- func GenSetToDisk(folderPath string, items []GenSet) error
- func GenTestDiffs(toSlice []types.TestOptions, includeNodeCount bool) []string
- func GetCPUFieldNames(to types.TestOptions) []string
- func GetMergedResults(filePath string) (mergedStats stats.MergedStats, err error)
- func GetYIndex(value string) string
- func JoinResults(allResults []ResultFile, profileResults []CPUProfileResult)
- func LoadProfiles(folderPath string, toMap map[uint64]types.TestOptions) (retCPU []CPUProfileResult, retMem []MemProfileResult, err error)
- func LoadTestOptions(folderPath string) (map[uint64]types.TestOptions, error)
- func MakeOutput(folderPath string, varyField VaryField, extraNames []VaryField, ...) error
- func SortByNodeCount(results []ResultFile) map[types.ConsType][]ResultFile
- func SortByNodeCountProfile(results []CPUProfileResult, ret map[types.ConsType][]CPUProfileResult)
- func SplitByField(allResults []ResultFile, fieldName string) map[interface{}][]ResultFile
- func WriteLatexFooter(writer io.Writer) (n int, err error)
- func WriteLatexHeader(writer io.Writer) (n int, err error)
- type CPUProfileResult
- type CPUResult
- type FilterBoolField
- type FilterIntField
- type FilterStringField
- type GenItem
- type GenSet
- type GraphProperties
- type GraphType
- type Header
- type MemProfileResult
- type PrintTable
- type ResultFile
- type SplitItem
- type VaryField
Constants ¶
const ( GenMergedGraphs = false GenPerProcGraphs = true )
const ( GenSetsFileName = "gensets.json" GenSetsFolderName = "gensets" )
Variables ¶
var ActTitle = "Time Per Decision (ms)"
var AllMultiPlotTitles = []map[string]int{MultiPlotTitles, MultiPlotTitles2, MultiPlotTitles3, MultiPlotTitles4}
var AllMultipPlotFiles = []string{MultiPlotFile, MultiPlotFile2, MultiPlotFile3, MultiPlotFile4}
var ByzMap = map[string]string{
"BinaryBoth": "B",
"BinaryFlip": "F",
"HalfHalfFixedBin": "H",
"HalfHalfNormal": "HF",
"Mute": "M",
"NonFaulty": "N",
}
var ByzNodeFilter = FilterBoolField{Name: "ByzNode", Values: []bool{true}}
var CoinMap = map[string]string{
"KnownCoin": "kc",
"LocalCoin": "lc",
"StrongCoin1": "sc",
"StrongCoin1Echo": "sce",
"StrongCoin2": "pc",
"StrongCoin2Echo": "pce",
}
var ConsTitle = "Time Per Consensus (ms)"
var DivStats = map[string]bool{"RoundParticipation": true, "RoundDecide": true, "DiskStorage": true, "Signed": true, "ThrshCreated": true, "Validated": true, "VRFCreated": true, "VRFValidated": true, "CoinValidated": true, "CoinCreated": true, "ForwardState": true, "MsgsSent": true, "BytesSent": true, "MaxMsgsSent": true, "MaxBytesSent": true, "ProposalForwarded": true, "MinMsgsSent": true, "MinBytesSent": true, "ConsMsgsSent": true, "ConsBytesSent": true, "ConsProposalForwarded": true, "ValuesDecidedCount": true}
DivStats are the ones that need to be divided by the number of nodes to get the per node value.
var GenByByzTypes = GenSet{ Name: "ByByzTypes", BoolFilterFields: []FilterBoolField{PerProcFilter, NonByzFilter, NonTotalFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "ByzType", Title: "Fault_Type", NameMap: ByzMap}, ExtraFields: []VaryField{ {VaryField: "ConsType", NameMap: RndCTMap}, {VaryField: "CoinType", Title: "CI:", NameMap: CoinMap}, }}}, SplitItems: []*SplitItem{{FieldName: "BinConsPercentOnes"}}, }
var GenByCoinPresetsTypes = GenSet{ Name: "ByCoinPresets", BoolFilterFields: []FilterBoolField{PerProcFilter, NonByzFilter, NonTotalFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "UseFixedCoinPresets", Title: "Coin_Presets", NameMap: TrueFalseMap}, ExtraFields: []VaryField{ {VaryField: "ConsType", NameMap: RndCTMap}, }}}, SplitItems: []*SplitItem{{FieldName: "BinConsPercentOnes"}}, }
var GenByNodeCount = GenSet{ Name: "ByNodeCount", BoolFilterFields: []FilterBoolField{PerProcFilter, TotalFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "NodeCount"}, ExtraFields: []VaryField{ {VaryField: "ConsType", NameMap: RndCTMap}, }}}, SplitItems: []*SplitItem{{FieldName: "BinConsPercentOnes"}}, }
var GenByNodesPercentOnes = GenSet{ Name: "PercentOnesByNodes", BoolFilterFields: []FilterBoolField{PerProcFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "BinConsPercentOnes", Title: "%_1"}, ExtraFields: []VaryField{{VaryField: "NodeCount"}}}}, SplitItems: []*SplitItem{{FieldName: "ConsType", NextSplitItem: &SplitItem{FieldName: "AllowSupportCoin", NextSplitItem: &SplitItem{FieldName: "IncludeProofs"}}}}, }
var GenByNodesSupportCoin = GenSet{ Name: "NodesBySupportCoin", BoolFilterFields: []FilterBoolField{PerProcFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "NodeCount"}, ExtraFields: []VaryField{ {VaryField: "AllowSupportCoin", Title: "_CombineMsgs"}}}}, SplitItems: []*SplitItem{{FieldName: "ConsType"}}, }
var GenByNodesSupportCoinProofs = GenSet{ Name: "NodesBySupportCoin", BoolFilterFields: []FilterBoolField{PerProcFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "NodeCount"}, ExtraFields: []VaryField{ {VaryField: "AllowSupportCoin", Title: "_CombineMsgs"}, {VaryField: "IncludeProofs", Title: "_Proofs"}}}}, SplitItems: []*SplitItem{{FieldName: "ConsType", NextSplitItem: &SplitItem{FieldName: "IncludeProofs"}}}, }
var GenByPercentOnes = GenSet{ Name: "ByPercentOnes", BoolFilterFields: []FilterBoolField{PerProcFilter, TotalFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "BinConsPercentOnes", Title: "Percent_1_Proposals"}, ExtraFields: []VaryField{ {VaryField: "ConsType", NameMap: RndCTMap}, }}}, }
var GenByPercentOnesCoinType = GenSet{ Name: "ByPercentOnes", BoolFilterFields: []FilterBoolField{PerProcFilter, TotalFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "BinConsPercentOnes", Title: "Percent_1_Proposals"}, ExtraFields: []VaryField{ {VaryField: "ConsType", NameMap: RndCTMap}, {VaryField: "CoinType", Title: "CI:", NameMap: CoinMap}, }}}, }
var GenByPercentOnesCombine = GenSet{ Name: "ByPercentOnes", BoolFilterFields: []FilterBoolField{PerProcFilter, TotalFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "BinConsPercentOnes", Title: "Percent_1_Proposals"}, ExtraFields: []VaryField{ {VaryField: "ConsType", NameMap: RndCTMap}, {VaryField: "AllowSupportCoin", Title: "CM:", NameMap: TrueFalseMap}, }}}, }
var GenByPercentOnesIncludeProofs = GenSet{ Name: "ByPercentOnes", BoolFilterFields: []FilterBoolField{PerProcFilter, TotalFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "BinConsPercentOnes", Title: "Percent_1_Proposals"}, ExtraFields: []VaryField{ {VaryField: "ConsType", NameMap: RndCTMap}, {VaryField: "IncludeProofs", Title: "IP:", NameMap: TrueFalseMap}, }}}, }
var GenByPercentOnesInclueProofs = GenSet{ Name: "ByPercentOnesIncludeProofs", BoolFilterFields: []FilterBoolField{PerProcFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "BinConsPercentOnes", Title: "%_1"}, ExtraFields: []VaryField{{VaryField: "IncludeProofs"}}, }}, SplitItems: []*SplitItem{{FieldName: "ConsType", NextSplitItem: &SplitItem{FieldName: "NodeCount", NextSplitItem: &SplitItem{FieldName: "AllowSupportCoin"}}}}, }
var GenPerNodeByCoin = GenSet{ Name: "CoinType", BoolFilterFields: []FilterBoolField{PerProcFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "CoinType"}, ExtraFields: []VaryField{ {VaryField: "ConsType"}}}}, }
var GenPerNodeByCons = GenSet{ Name: "NodeCount", BoolFilterFields: []FilterBoolField{PerProcFilter, TotalFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "NodeCount"}, ExtraFields: []VaryField{ {VaryField: "ConsType", NameMap: RndCTMap}, }}}, }
var GenPerNodeByConsBuffFwd = GenSet{ Name: "NodeCount", BoolFilterFields: []FilterBoolField{PerProcFilter, TotalFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "NodeCount"}, ExtraFields: []VaryField{ {VaryField: "ConsType", NameMap: RndCTMap}, {VaryField: "BufferForwardType", Title: "BFT"}, }}}, }
var GenPerNodeByConsCB = GenSet{ Name: "NodeCount", BoolFilterFields: []FilterBoolField{PerProcFilter, TotalFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "NodeCount"}, ExtraFields: []VaryField{ {VaryField: "ConsType", NameMap: RndCTMap}, {VaryField: "CollectBroadcast", Title: "CB"}, }}}, }
var GenPerNodeByConsCoin = GenSet{ Name: "NodeCount", BoolFilterFields: []FilterBoolField{PerProcFilter, TotalFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "NodeCount"}, ExtraFields: []VaryField{ {VaryField: "ConsType", NameMap: RndCTMap}, {VaryField: "CoinType", Title: "CI:", NameMap: CoinMap}, }}}, }
var GenPerNodeByConsMvCons4BcastType = GenSet{ Name: "NodeCount", BoolFilterFields: []FilterBoolField{PerProcFilter, TotalFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "NodeCount"}, ExtraFields: []VaryField{ {VaryField: "ConsType", NameMap: RndCTMap}, {VaryField: "MvCons4BcastType", Title: "nil", NameMap: MvCons4BcastTypeMap}, }}}, }
var GenPerNodeByRndMemberType = GenSet{ Name: "RandomMemberType", BoolFilterFields: []FilterBoolField{PerProcFilter, TotalFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "NodeCount"}, ExtraFields: []VaryField{ {VaryField: "ConsType", Title: "CT:", NameMap: RndCTMap}, {VaryField: "RndMemberType", Title: "RMT", NameMap: RndMemberMap}, }}}, }
var GenPerRndMemberTypeByCons = GenSet{ Name: "RndMemberType", BoolFilterFields: []FilterBoolField{PerProcFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "RndMemberType"}, ExtraFields: []VaryField{ {VaryField: "NodeCount"}, {VaryField: "ConsType"}}}}, }
var GenPerTOByCons = GenSet{ Name: "TO", BoolFilterFields: []FilterBoolField{PerProcFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "TestID"}, ExtraFields: []VaryField{ {VaryField: "NodeCount"}, {VaryField: "ConsType"}}}}, }
var GenPerToNodeByCons = GenSet{ Name: "PerTO", BoolFilterFields: []FilterBoolField{PerProcFilter}, GenItems: []GenItem{{VaryField: VaryField{VaryField: "NodeCount"}, ExtraFields: []VaryField{ {VaryField: "ConsType"}}}}, SplitItems: []*SplitItem{{FieldName: "TestID"}}, }
var GraphTypes = []GraphProperties{{GraphType: NormalType, Width: 1600, Height: 1200}, {GraphType: PaperType, Width: 400, Height: 400}}
var MultiPlotFile = "./scripts/graphscripts/multiplotfile.gp"
var MultiPlotFile2 = "./scripts/graphscripts/multiplotfile2.gp"
var MultiPlotFile3 = "./scripts/graphscripts/multiplotfile3.gp"
var MultiPlotFile4 = "./scripts/graphscripts/multiplotfile4.gp"
var MultiPlotGraphTypes = []GraphProperties{{GraphType: NormalType, Width: 1600, Height: 1200}, {GraphType: PaperType, Width: 800, Height: 600}}
var MultiPlotTitles = map[string]int{ActTitle: 1, "BytesSent": 2, "MsgsSent": 3, "RoundDecide": 4}
var MultiPlotTitles2 = map[string]int{ActTitle: 1, ConsTitle: 2, "ConsBytesSent": 3, "ConsMsgsSent": 4}
var MultiPlotTitles3 = map[string]int{ActTitle: 1, ConsTitle: 2, "ConsBytesSent": 3, "Signed": 4}
var MultiPlotTitles4 = map[string]int{ActTitle: 1, "ConsMsgsSent": 2, "ConsBytesSent": 3, "Signed": 4}
var MvCons4BcastTypeMap = map[string]string{"Normal": "", "Direct": "Direct", "Indices": "Sync"}
var NonByzFilter = FilterBoolField{Name: "ByzNode", Values: []bool{false}}
var NonTotalFilter = FilterBoolField{Name: "Total", Values: []bool{false}}
var PerProcFilter = FilterBoolField{Name: "PerProc", Values: []bool{true}}
var RndCTMap = map[string]string{
"BinConsRnd1": "BC:s1",
"BinConsRnd2": "BC:ns1",
"BinConsRnd3": "BC:s2",
"BinConsRnd4": "BC:ns2",
"BinConsRnd5": "BC:s3",
"BinConsRnd6": "BC:ns3",
"MvCons2": "MC:3S",
"MvBinConsRnd2": "MC:4S",
"MvCons3": "MC:2S",
"MvCons4": "MC:MP",
"RbBcast1": "RB:2S",
"RbBcast2": "RB:3S",
}
var RndMemberMap = map[string]string{
"NotRandom": "NR",
"KnownPerCons": "KPC",
"VRFPerCons": "VPC",
"VRFPerMessage": "VPM",
}
var SigCPUFieldNames = []string{
"SignatureCreation",
"SignatureValidation",
"OtherOperations",
}
var SigMsgMap = map[string]string{"true": "y", "false": "n"}
var SocMap = map[string]string{"NextRound": "nr", "SendProof": "sp"}
var StatsNames = []string{
"Signed",
"Validated",
"VRFCreated",
"VRFValidated",
"ThrshCreated",
"RoundDecide",
"RoundParticipation",
"DiskStorage",
"DecidedNil",
"MsgsSent",
"BytesSent",
"BufferForwardTimeouts",
"ConsMsgsSent",
"ConsBytesSent",
"ConsBufferForwardTimeouts",
"ProposalCount",
"MemberCount",
"ProposalForwarded",
"ForwardState",
"ProgressTimeout",
"ValuesDecidedCount",
}
StatsNames is the list of statistics that will be used to create graphs
var ThrshCPUFieldNames = []string{
"SignatureCreation",
"SignatureValidation",
"CombinePartials",
"OtherOperations",
}
var TotalFilter = FilterBoolField{Name: "Total", Values: []bool{true}}
var TrueFalseMap = map[string]string{
"true": "Y",
"false": "N",
}
var VRFCPUFieldNames = []string{
"SignatureCreation",
"VRFCreation",
"SignatureValidation",
"VRFValidation",
"CombinePartials",
"OtherOperations",
}
var YIndexMap = map[string]string{"MsgsSent": "Messages Sent", "RoundDecide": "Decision Round", "BytesSent": "Bytes Sent"}
Functions ¶
func ComputePerTo ¶
func ComputePerTo(results []ResultFile) map[string][2]map[uint64][]ResultFile
func ComputePerToAllTypes ¶
func ComputePerToAllTypes(results []ResultFile) (ret [2]map[uint64][]ResultFile)
func ComputePerToAllTypesProfile ¶
func ComputePerToAllTypesProfile(results []CPUProfileResult) (ret map[uint64][]CPUProfileResult)
func ComputePerToPerNodeCount ¶
func ComputePerToPerNodeCount(results []ResultFile) map[int]map[string][2]map[uint64][]ResultFile
func ComputePerToPerNodeCountProfile ¶
func ComputePerToPerNodeCountProfile(results []CPUProfileResult) map[int]map[string]map[uint64][]CPUProfileResult
func ComputePerToProfile ¶
func ComputePerToProfile(results []CPUProfileResult) map[string]map[uint64][]CPUProfileResult
func GenGraphByGenSet ¶
func GenGraphByGenSet(folderPath string, genSet GenSet, allResults []ResultFile)
func GenMultiPlot ¶
func GenMultiPlot(idx int, folderPath, gnuPlotFile string, properties []GraphProperties, args []string) error
func GenProfileGraph ¶
func GenResults ¶
func GenSetToDisk ¶
GenSetToDisk stores the items to disk in folderPath, using const GenSetsFileName as the file name.
func GenTestDiffs ¶
func GenTestDiffs(toSlice []types.TestOptions, includeNodeCount bool) []string
GetTestDiffs returns the fields that differ in the test options.
func GetCPUFieldNames ¶
func GetCPUFieldNames(to types.TestOptions) []string
func GetMergedResults ¶
func GetMergedResults(filePath string) (mergedStats stats.MergedStats, err error)
GetMergedResults generates a stats.MergedStats object from a json formatted file.
func JoinResults ¶
func JoinResults(allResults []ResultFile, profileResults []CPUProfileResult)
func LoadProfiles ¶
func LoadProfiles(folderPath string, toMap map[uint64]types.TestOptions) ( retCPU []CPUProfileResult, retMem []MemProfileResult, err error)
func LoadTestOptions ¶
func LoadTestOptions(folderPath string) (map[uint64]types.TestOptions, error)
LoadTestOptions loads all the test options files in the folder path, and stores them in a map where TestOptions.TestID is used as the key.
func MakeOutput ¶
func SortByNodeCount ¶
func SortByNodeCount(results []ResultFile) map[types.ConsType][]ResultFile
func SortByNodeCountProfile ¶
func SortByNodeCountProfile(results []CPUProfileResult, ret map[types.ConsType][]CPUProfileResult)
func SplitByField ¶
func SplitByField(allResults []ResultFile, fieldName string) map[interface{}][]ResultFile
SplitByField returns a map where the keys are the values of fieldName from allResults, and the values are maps from the cons types to the result files that correspond the the value of the fieldName.
Types ¶
type CPUProfileResult ¶
type FilterBoolField ¶
type FilterIntField ¶
type FilterStringField ¶
type GenSet ¶
type GenSet struct { Name string FilterStringFields []FilterStringField FilterIntFields []FilterIntField BoolFilterFields []FilterBoolField SplitItems []*SplitItem GenItems []GenItem }
func LoadGenSets ¶
type GraphProperties ¶
type MemProfileResult ¶
type PrintTable ¶
type PrintTable struct {
// contains filtered or unexported fields
}
func (*PrintTable) AddMinMaxRow ¶
func (pt *PrintTable) AddMinMaxRow(title interface{}, values [3][][3]interface{}, roundTo int) (n int, err error)
type ResultFile ¶
type ResultFile struct { CPUProfileResults []CPUProfileResult FileName string stats.MergedStats NodeCount int PerProc bool ByzNode bool Total bool NodeType string types.TestOptions }
func FilterResultsFiles ¶
func FilterResultsFiles(allResults []ResultFile, stringFilters []FilterStringField, intFilters []FilterIntField, boolFilters []FilterBoolField) []ResultFile
FilterResultsFiles returns a map of the results from allResults that match any value for either of the string filters or int filters.
func LoadResults ¶
func LoadResults(folderPath string, toMap map[uint64]types.TestOptions) (ret []ResultFile, err error)
LoadResults load the MergedStats results for the given test options from the folder path.
type VaryField ¶
func GetCPUFieldNamesResultFile ¶
func GetCPUFieldNamesResultFile(results []ResultFile) []VaryField