Documentation ¶
Overview ¶
Cytoscape package provides conversion from our graph to the CystoscapeJS configuration json model.
The following links are useful for understanding CytoscapeJS and it's configuration:
Main page: http://js.cytoscape.org/ JSON config: http://js.cytoscape.org/#notation/elements-json Demos: http://js.cytoscape.org/#demos
Algorithm: Process the graph structure adding nodes and edges, decorating each
with information provided. An optional second pass generates compound nodes for version grouping.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Timestamp int64 `json:"timestamp"` Duration int64 `json:"duration"` GraphType string `json:"graphType"` Elements Elements `json:"elements"` }
func NewConfig ¶
func NewConfig(trafficMap graph.TrafficMap, o options.VendorOptions) (result Config)
type EdgeData ¶
type EdgeData struct { // Cytoscape Fields Id string `json:"id"` // unique internal edge ID (e0, e1...) Source string `json:"source"` // parent node ID Target string `json:"target"` // child node ID // App Fields (not required by Cytoscape) Http string `json:"http,omitempty"` // requests per second, 2 digit precision Http3xx string `json:"http3XX,omitempty"` // requests per second, 2 digit precision Http4xx string `json:"http4XX,omitempty"` // requests per second, 2 digit precision Http5xx string `json:"http5XX,omitempty"` // requests per second, 2 digit precision HttpPercentErr string `json:"httpPercentErr,omitempty"` // percent of error responses, 1 digit precision HttpPercentReq string `json:"httpPercentReq,omitempty"` // percent of total parent requests, 1 digit precision ResponseTime string `json:"responseTime,omitempty"` // in millis IsMTLS bool `json:"isMTLS,omitempty"` // true (mutual TLS connection) | false IsUnused bool `json:"isUnused,omitempty"` // true | false Tcp string `json:"tcp,omitempty"` // bytes per second, 2 digit precision }
type EdgeWrapper ¶
type EdgeWrapper struct {
Data *EdgeData `json:"data"`
}
type Elements ¶
type Elements struct { Nodes []*NodeWrapper `json:"nodes"` Edges []*EdgeWrapper `json:"edges"` }
type NodeData ¶
type NodeData struct { // Cytoscape Fields Id string `json:"id"` // unique internal node ID (n0, n1...) Parent string `json:"parent,omitempty"` // Compound Node parent ID // App Fields (not required by Cytoscape) NodeType string `json:"nodeType"` Namespace string `json:"namespace"` Workload string `json:"workload,omitempty"` App string `json:"app,omitempty"` Version string `json:"version,omitempty"` Service string `json:"service,omitempty"` // requested service for NodeTypeService DestServices map[string]bool `json:"destServices,omitempty"` // requested services for [dest] node HttpIn string `json:"httpIn,omitempty"` // incoming edge aggregate, requests per second, 2 digit precision HttpIn3xx string `json:"httpIn3XX,omitempty"` // incoming edge aggregate, requests per second, 2 digit precision HttpIn4xx string `json:"httpIn4XX,omitempty"` // incoming edge aggregate, requests per second, 2 digit precision HttpIn5xx string `json:"httpIn5XX,omitempty"` // incoming edge aggregate, requests per second, 2 digit precision HttpOut string `json:"httpOut,omitempty"` // outgoing edge aggregate, requests per second, 2 digit precision TcpIn string `json:"tcpIn,omitempty"` // incoming edge aggregate, bytes per second, 2 digit precision TcpOut string `json:"tcpOut,omitempty"` // outgoing edge aggregate, bytes per second, 2 digit precision HasCB bool `json:"hasCB,omitempty"` // true (has circuit breaker) | false HasMissingSC bool `json:"hasMissingSC,omitempty"` // true (has missing sidecar) | false HasVS bool `json:"hasVS,omitempty"` // true (has route rule) | false IsDead bool `json:"isDead,omitempty"` // true (has no pods) | false IsGroup string `json:"isGroup,omitempty"` // set to the grouping type, current values: [ 'app', 'version' ] IsInaccessible bool `json:"isInaccessible,omitempty"` // true if the node exists in an inaccessible namespace IsMisconfigured string `json:"isMisconfigured,omitempty"` // set to misconfiguration list, current values: [ 'labels' ] IsOutside bool `json:"isOutside,omitempty"` // true | false IsRoot bool `json:"isRoot,omitempty"` // true | false IsServiceEntry string `json:"isServiceEntry,omitempty"` // set to the location, current values: [ 'MESH_EXTERNAL', 'MESH_INTERNAL' ] IsUnused bool `json:"isUnused,omitempty"` // true | false }
type NodeWrapper ¶
type NodeWrapper struct {
Data *NodeData `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.