parse

package
v0.0.0-...-ff61ee7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2020 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GenMergedGraphs  = false
	GenPerProcGraphs = true
)
View Source
const (
	GenSetsFileName   = "gensets.json"
	GenSetsFolderName = "gensets"
)

Variables

View Source
var ActTitle = "Time Per Decision (ms)"
View Source
var ByzMap = map[string]string{
	"BinaryBoth":       "B",
	"BinaryFlip":       "F",
	"HalfHalfFixedBin": "H",
	"HalfHalfNormal":   "HF",
	"Mute":             "M",
	"NonFaulty":        "N",
}
View Source
var ByzNodeFilter = FilterBoolField{Name: "ByzNode", Values: []bool{true}}
View Source
var CoinMap = map[string]string{
	"KnownCoin":       "kc",
	"LocalCoin":       "lc",
	"StrongCoin1":     "sc",
	"StrongCoin1Echo": "sce",
	"StrongCoin2":     "pc",
	"StrongCoin2Echo": "pce",
}
View Source
var ConsTitle = "Time Per Consensus (ms)"
View Source
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.

View Source
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"}},
}
View Source
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"}},
}
View Source
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"}},
}
View Source
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"}}}},
}
View Source
var GenByNodesSupportCoin = GenSet{
	Name: "NodesBySupportCoin",

	BoolFilterFields: []FilterBoolField{PerProcFilter},
	GenItems: []GenItem{{VaryField: VaryField{VaryField: "NodeCount"}, ExtraFields: []VaryField{
		{VaryField: "AllowSupportCoin", Title: "_CombineMsgs"}}}},
	SplitItems: []*SplitItem{{FieldName: "ConsType"}},
}
View Source
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"}}},
}
View Source
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},
		}}},
}
View Source
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},
		}}},
}
View Source
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},
		}}},
}
View Source
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},
		}}},
}
View Source
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"}}}},
}
View Source
var GenPerNodeByCoin = GenSet{
	Name:             "CoinType",
	BoolFilterFields: []FilterBoolField{PerProcFilter},
	GenItems: []GenItem{{VaryField: VaryField{VaryField: "CoinType"}, ExtraFields: []VaryField{
		{VaryField: "ConsType"}}}},
}
View Source
var GenPerNodeByCons = GenSet{
	Name:             "NodeCount",
	BoolFilterFields: []FilterBoolField{PerProcFilter, TotalFilter},
	GenItems: []GenItem{{VaryField: VaryField{VaryField: "NodeCount"}, ExtraFields: []VaryField{
		{VaryField: "ConsType", NameMap: RndCTMap},
	}}},
}
View Source
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"},
	}}},
}
View Source
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"},
	}}},
}
View Source
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},
	}}},
}
View Source
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},
	}}},
}
View Source
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},
		}}},
}
View Source
var GenPerRndMemberTypeByCons = GenSet{
	Name:             "RndMemberType",
	BoolFilterFields: []FilterBoolField{PerProcFilter},
	GenItems: []GenItem{{VaryField: VaryField{VaryField: "RndMemberType"}, ExtraFields: []VaryField{
		{VaryField: "NodeCount"}, {VaryField: "ConsType"}}}},
}
View Source
var GenPerTOByCons = GenSet{
	Name:             "TO",
	BoolFilterFields: []FilterBoolField{PerProcFilter},
	GenItems: []GenItem{{VaryField: VaryField{VaryField: "TestID"}, ExtraFields: []VaryField{
		{VaryField: "NodeCount"}, {VaryField: "ConsType"}}}},
}
View Source
var GenPerToNodeByCons = GenSet{
	Name:             "PerTO",
	BoolFilterFields: []FilterBoolField{PerProcFilter},
	GenItems: []GenItem{{VaryField: VaryField{VaryField: "NodeCount"}, ExtraFields: []VaryField{
		{VaryField: "ConsType"}}}},
	SplitItems: []*SplitItem{{FieldName: "TestID"}},
}
View Source
var GraphTypes = []GraphProperties{{GraphType: NormalType, Width: 1600, Height: 1200},
	{GraphType: PaperType, Width: 400, Height: 400}}
View Source
var MultiPlotFile = "./scripts/graphscripts/multiplotfile.gp"
View Source
var MultiPlotFile2 = "./scripts/graphscripts/multiplotfile2.gp"
View Source
var MultiPlotFile3 = "./scripts/graphscripts/multiplotfile3.gp"
View Source
var MultiPlotFile4 = "./scripts/graphscripts/multiplotfile4.gp"
View Source
var MultiPlotGraphTypes = []GraphProperties{{GraphType: NormalType, Width: 1600, Height: 1200},
	{GraphType: PaperType, Width: 800, Height: 600}}
View Source
var MultiPlotTitles = map[string]int{ActTitle: 1, "BytesSent": 2, "MsgsSent": 3, "RoundDecide": 4}
View Source
var MultiPlotTitles2 = map[string]int{ActTitle: 1, ConsTitle: 2, "ConsBytesSent": 3, "ConsMsgsSent": 4}
View Source
var MultiPlotTitles3 = map[string]int{ActTitle: 1, ConsTitle: 2, "ConsBytesSent": 3, "Signed": 4}
View Source
var MultiPlotTitles4 = map[string]int{ActTitle: 1, "ConsMsgsSent": 2, "ConsBytesSent": 3, "Signed": 4}
View Source
var MvCons4BcastTypeMap = map[string]string{"Normal": "", "Direct": "Direct", "Indices": "Sync"}
View Source
var NonByzFilter = FilterBoolField{Name: "ByzNode", Values: []bool{false}}
View Source
var NonTotalFilter = FilterBoolField{Name: "Total", Values: []bool{false}}
View Source
var PerProcFilter = FilterBoolField{Name: "PerProc", Values: []bool{true}}
View Source
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",
}
View Source
var RndMemberMap = map[string]string{
	"NotRandom":     "NR",
	"KnownPerCons":  "KPC",
	"VRFPerCons":    "VPC",
	"VRFPerMessage": "VPM",
}
View Source
var SigCPUFieldNames = []string{
	"SignatureCreation",
	"SignatureValidation",
	"OtherOperations",
}
View Source
var SigMsgMap = map[string]string{"true": "y", "false": "n"}
View Source
var SocMap = map[string]string{"NextRound": "nr", "SendProof": "sp"}
View Source
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

View Source
var ThrshCPUFieldNames = []string{
	"SignatureCreation",
	"SignatureValidation",
	"CombinePartials",
	"OtherOperations",
}
View Source
var TotalFilter = FilterBoolField{Name: "Total", Values: []bool{true}}
View Source
var TrueFalseMap = map[string]string{
	"true":  "Y",
	"false": "N",
}
View Source
var VRFCPUFieldNames = []string{
	"SignatureCreation",
	"VRFCreation",
	"SignatureValidation",
	"VRFValidation",
	"CombinePartials",
	"OtherOperations",
}
View Source
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 GenGraph

func GenGraph(title, xLabel, yLabel, folderPath string, extraNames []VaryField, inputFiles []string,
	properties []GraphProperties, isMultiPlot []int, genTable bool) (multiPlotStrings [][]string, err error)

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 GenProfileGraph(title, xLabel, yLabel string, numFields int,
	folderPath string, extraNames []VaryField, inputFiles []string, properties []GraphProperties) error

func GenResults

func GenResults(folderPath string) error

func GenSetToDisk

func GenSetToDisk(folderPath string, items []GenSet) error

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 GetYIndex

func GetYIndex(value string) string

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 MakeOutput(folderPath string, varyField VaryField, extraNames []VaryField, cpuFieldNames []VaryField,
	items map[types.ConsType][]ResultFile,
	profileItems map[types.ConsType][]CPUProfileResult, includeConsType bool) error

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.

func WriteLatexFooter

func WriteLatexFooter(writer io.Writer) (n int, err error)

func WriteLatexHeader

func WriteLatexHeader(writer io.Writer) (n int, err error)

Types

type CPUProfileResult

type CPUProfileResult struct {
	CPUResult
	CPUFileName string
	NodeIndex   int
	NodeCount   int
	types.TestOptions
}

type CPUResult

type CPUResult struct {
	AllTime             uint64
	OtherOperations     uint64
	VRFCreation         uint64
	VRFValidation       uint64
	SignatureValidation uint64
	SignatureCreation   uint64
	CombinePartials     uint64
}

type FilterBoolField

type FilterBoolField struct {
	Name   string
	Values []bool
}

type FilterIntField

type FilterIntField struct {
	Name   string
	Values []int
}

type FilterStringField

type FilterStringField struct {
	Name   string
	Values []string
}

type GenItem

type GenItem struct {
	VaryField   VaryField
	ExtraFields []VaryField
}

type GenSet

type GenSet struct {
	Name string

	FilterStringFields []FilterStringField
	FilterIntFields    []FilterIntField
	BoolFilterFields   []FilterBoolField

	SplitItems []*SplitItem

	GenItems []GenItem
}

func LoadGenSets

func LoadGenSets(folderPath string) (ret []GenSet, err error)

type GraphProperties

type GraphProperties struct {
	GraphType
	Name          string
	Width, Height int
}

type GraphType

type GraphType int
const (
	NormalType GraphType = iota
	PaperType
)

func (GraphType) String

func (gt GraphType) String() string
type Header struct {
	// contains filtered or unexported fields
}

func NewHeader

func NewHeader(name string, minMax bool) Header

type MemProfileResult

type MemProfileResult struct {
	MemStartFileName string
	MemEndFileName   string
	NodeIndex        int
	NodeCount        int
	types.TestOptions
}

type PrintTable

type PrintTable struct {
	// contains filtered or unexported fields
}

func InitTable

func InitTable(leftHeader string, headers []Header, hasMinMaxRow bool, writer io.Writer) (ret *PrintTable, n int, err error)

func (*PrintTable) AddMinMaxRow

func (pt *PrintTable) AddMinMaxRow(title interface{}, values [3][][3]interface{}, roundTo int) (n int, err error)

func (*PrintTable) AddRow

func (pt *PrintTable) AddRow(title interface{}, values [][3]interface{}, roundTo int) (n int, err error)

func (*PrintTable) Done

func (pt *PrintTable) Done(caption string) (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 SplitItem

type SplitItem struct {
	FieldName     string
	NextSplitItem *SplitItem
}

type VaryField

type VaryField struct {
	Title     string
	VaryField string
	NameMap   map[string]string
}

func GetCPUFieldNamesResultFile

func GetCPUFieldNamesResultFile(results []ResultFile) []VaryField

func (VaryField) GetTitle

func (vf VaryField) GetTitle() string

func (VaryField) GetValue

func (vf VaryField) GetValue(value interface{}) interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL