WILCO
  • 👩‍🎓User Manual
    • USER MANUAL
      • welcome page
        • create an account
        • login
          • login troubleshooting
        • logout
      • landing page
      • fleet dashboards
        • URL
        • fleet header
        • fleet
        • current alerts
        • map
      • aircraft timeline
        • overview
        • timeline header
          • calendar
          • warnings
          • show cleared
          • show hidden
        • tags
        • custom message
      • dashboards
        • overview
        • header
        • dashboard
        • parameters
          • search parameter
          • plot graph
          • trend chart
      • open a ticket
    • DESIGNER USER MANUAL
      • Manual post
        • copy text
        • upload file
          • CSV insertion
          • elasticsearch aggregation
      • Edit layouts
        • type of layouts
        • manage layouts and uplinks
        • create layout
          • report parser
          • web connector
        • IFT at Layout
      • Edit Fault codes
        • IFT at Fault Code
      • Edit parameters
        • IFT at Parameter
      • Edit Dashboards
        • create new dashboard
        • edit dashboard
        • Dashboards
          • Dashboard drawing tips
            • Illustrator
          • Dashboard rules
            • Libraries
            • Variables
            • Utils
            • Debugging the rules
            • Graphs
              • creation of the graph
              • Set the title of the graph
              • draw some zones
              • draw a serie (curve)
              • draw horizontal line
              • draw vertical line
              • draw circles
              • Example
            • WILCO.alertWarning
              • WILCO.alertInfo
            • WILCO.alertError
            • WILCO.api
            • WILCO.user
            • WILCO.getEventsForFwot
            • WILCO.getEventsForFwotMinMaxDate
            • WILCO.getSamplesForFwot
            • WILCO.getSamplesForFwotMinMaxDate
            • WILCO.getSampleTableForFwot
            • WILCO.getSamplesTableForFwotMinMaxDate
            • WILCO.getEventsStats
            • WILCO.dsv
            • WILCO.uplink
      • Edit Trends
        • create new trend
        • edit trend
        • Trends
          • Use the tags
          • Access to the surrounding values
      • Edit IFTs
        • edit IFT
        • create an IFT
        • IFT V2
          • moment
          • underscore
          • current Fwot
          • Samples
          • FW.api
          • FW.getWilcoUrls
          • FW.http
          • FW.getEvent
          • FW.getOtherEvent
          • FW.getEvents
          • FW.getFwot
          • FW.getFwots
          • FW.notify <deprecated>
          • FW.notifyWithTemplate <deprecated>
          • FW.email
          • FW.setFrom
          • FW.setTo
          • FW.setTitle
          • FW.setVisible
          • FW.setSeverity
          • FW.setComputedDate
          • FW.setStyle
          • FW.getSamples
          • FW.report
          • FW.reportInfo
          • FW.reportWarn
          • FW.reportFault
          • FW.reportError
          • FW.log
          • FW.updateProperties
          • FW.setFlightStatus
          • FW.setLoc
          • FW.uplink
          • FW.set
          • FW.updateSomeFwotProperty
          • FW.updateFwotProperty
          • FW.removeFwotProperty
          • FW.removeSomeFwotProperty
          • FW.tag
          • FW.untag
          • FW.postEvent
          • FW.reportFaultCode
          • FW.querySamples
          • FW.getRaw
          • FW.getBit
          • FW.csv
          • FW.machineLearningPredict
          • FW.webhook
          • FW.getPlugins()
          • FW.json
      • Show Uplinks
      • General Conf
        • Assets
          • Fwots
        • Configuration
          • Constants
          • Docs
          • Event tables
            • Tables
              • JSON structure
                • Title
                • filters
                • cols
                  • Fields of a column
                • Example
      • examples
        • flow of the data
        • use Constants
        • use Doc
        • use EventTable
        • use algorithm on trends
      • Code snippets
        • Get the last UPLINK message with filters
        • Automatically handle faultcodes according to a doc and a regex
        • Get the current airport
        • goto a page from a dashboard
        • get the samples and events over the 3 last legs
        • Webhooks: Get data from typeform and post it to ELK
        • Download a file from a SVG click
        • Clone a SVG template with D3
        • Cheat sheet
    • ADMIN USER MANUAL
      • General Conf
        • Access rights
          • API keys
          • Users
        • Assets
          • Airlines
          • Fwot types
          • Fwots
        • Configuration
          • App configs
            • UPLINK_ROUTING
            • SEND_MAIL
            • DO_UPLINK
            • UPLINK_PATH
            • MAX_DAYS_WITHOUT_EVENTS
            • ACARS_RECIPIENT
            • MAIL_TEMPLATE
            • USE_CURRENT_DATE
            • DO_UPLINK_AUTOMATIC_BLACKLIST
            • DO_UPLINK_MANUAL_BLACKLIST
            • UPLINK_EXPIRATION_MINUTES
          • Bookmarks
          • Constants
          • Docs
          • Event tables
          • Plugins
        • Swiss knife
      • Edit Plugins
        • Commit plugin
        • Deploy plugin
    • Q&A
  • 🔌Plugins
    • fw.ata49
      • Minimum requirements
      • Configuration
    • fw.fuelsave
      • Minimum requirements
      • Configuration
    • fw.opticooling
      • Minimum requirements
      • Configuration
    • fw.taxi
      • Minimum requirements
      • Configuration
    • fw.turnaround
Powered by GitBook
On this page

Was this helpful?

  1. User Manual
  2. DESIGNER USER MANUAL
  3. Edit Dashboards
  4. Dashboards
  5. Dashboard rules

WILCO.getEventsStats

WILCO.getEventsStats(reg, req)

return event statistics on a fwot. The results can be aggregated

This request is aggregated when it is called several times, for example on fleet views. It makes the server optimized.

const stats = await WILCO.getEventsStats(FWOT.reg, 
  {
//	severities: ["WARNING"],
    tags: this.tags,
  	from: this.momentWindow[0].format('YYYY-MM-DDTHH:mm:ss'),
  	to: this.momentWindow[1].format('YYYY-MM-DDTHH:mm:ss'),
  	dismissed: false,
    aggregates: [{
		kind: "TAG"
	}]
  }
);

Here are an example of requests and responses to the new API endpoint :

  • Job ALL-COUNT : count all events

  • Job DATE-RANGE : count all events between two dates

  • Job AFTER : count all events after a date

  • Job BEFORE : count all events before a date

  • Job KNOWN-REG: count all the events of reg FW-LUC

  • Job KNOWN-TAG: count all the events tagged REP2

  • Job SEVERITY-INFO: count all the events with the severity INFO

  • Job AGGR-REG: count all the events, aggregate results by reg

  • Job AGGR-TAG: count all the events, aggregate results by tags

  • Job AGGR-SEV: count all the events, aggregate results by severity

  • Job AGGR-REG-TAG: count all the events, aggregate results by reg and tag

  • Job COMBINED: count all the events between two dates that have the severity INFO and are tagged FLYING, aggregate results by reg

Client request:

[{
	"id": "ALL-COUNT"
}, {
	"id": "DATE-RANGE",
	"from": "2019-02-06T10:47:51",
	"to": "2019-02-08T10:47:51"
}, {
	"id": "AFTER",
	"from": "2019-02-08T10:47:51"
}, {
	"id": "BEFORE",
	"to": "2019-02-06T10:47:51"
}, {
	"id": "KNOWN-REG",
	"regs": ["FW-LUC"]
}, {
	"id": "KNOWN-TAG",
	"tags": ["REP2"]
}, {
	"id": "SEVERITY-INFO",
	"severities": ["INFO"]
}, {
	"id": "AGGR-REG",
	"aggregates": [{
		"kind": "REG"
	}]
}, {
	"id": "AGGR-TAG",
	"aggregates": [{
		"kind": "TAG"
	}]
}, {
	"id": "AGGR-SEV",
	"aggregates": [{
		"kind": "SEVERITY"
	}]
}, {
	"id": "AGGR-REG-TAG",
	"aggregates": [{
		"kind": "REG"
	}, {
		"kind": "TAG"
	}]
}, {
	"id": "COMBINED",
	"from": "2019-02-06T10:47:51",
	"to": "2019-02-08T10:47:51",
	"tags": ["FLYING"],
	"severities": ["INFO"],
	"aggregates": [{
		"kind": "REG"
	}]
}]

Server response:

[{
	"id": "ALL-COUNT",
	"result": {
		"count": 2
	}
}, {
	"id": "DATE-RANGE",
	"result": {
		"count": 2
	}
}, {
	"id": "AFTER",
	"result": {
		"count": 0
	}
}, {
	"id": "BEFORE",
	"result": {
		"count": 0
	}
}, {
	"id": "KNOWN-REG",
	"result": {
		"count": 2
	}
}, {
	"id": "KNOWN-TAG",
	"result": {
		"count": 1
	}
}, {
	"id": "SEVERITY-INFO",
	"result": {
		"count": 1
	}
}, {
	"id": "AGGR-REG",
	"result": {
		"FW-LUC": {
			"count": 2
		}
	}
}, {
	"id": "AGGR-TAG",
	"result": {
		"REP2": {
			"count": 1
		},
		"FLYING": {
			"count": 1
		}
	}
}, {
	"id": "AGGR-SEV",
	"result": {
		"NULL": {
			"count": 1
		},
		"INFO": {
			"count": 1
		}
	}
}, {
	"id": "AGGR-REG-TAG",
	"result": {
		"FW-LUC": {
			"REP2": {
				"count": 1
			},
			"FLYING": {
				"count": 1
			}
		}
	}
}, {
	"id": "COMBINED",
	"result": {
		"FW-LUC": {
			"count": 1
		}
	}
}]
PreviousWILCO.getSamplesTableForFwotMinMaxDateNextWILCO.dsv

Last updated 5 years ago

Was this helpful?

👩‍🎓