message.go 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Copyright 2017 The go-ethereum Authors
  2. // This file is part of the go-ethereum library.
  3. //
  4. // The go-ethereum library is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU Lesser General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // The go-ethereum library is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public License
  15. // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
  16. package dashboard
  17. import "time"
  18. type Message struct {
  19. General *GeneralMessage `json:"general,omitempty"`
  20. Home *HomeMessage `json:"home,omitempty"`
  21. Chain *ChainMessage `json:"chain,omitempty"`
  22. TxPool *TxPoolMessage `json:"txpool,omitempty"`
  23. Network *NetworkMessage `json:"network,omitempty"`
  24. System *SystemMessage `json:"system,omitempty"`
  25. Logs *LogsMessage `json:"logs,omitempty"`
  26. }
  27. type ChartEntries []*ChartEntry
  28. type ChartEntry struct {
  29. Time time.Time `json:"time,omitempty"`
  30. Value float64 `json:"value,omitempty"`
  31. }
  32. type GeneralMessage struct {
  33. Version string `json:"version,omitempty"`
  34. Commit string `json:"commit,omitempty"`
  35. }
  36. type HomeMessage struct {
  37. /* TODO (kurkomisi) */
  38. }
  39. type ChainMessage struct {
  40. /* TODO (kurkomisi) */
  41. }
  42. type TxPoolMessage struct {
  43. /* TODO (kurkomisi) */
  44. }
  45. type NetworkMessage struct {
  46. /* TODO (kurkomisi) */
  47. }
  48. type SystemMessage struct {
  49. ActiveMemory ChartEntries `json:"activeMemory,omitempty"`
  50. VirtualMemory ChartEntries `json:"virtualMemory,omitempty"`
  51. NetworkIngress ChartEntries `json:"networkIngress,omitempty"`
  52. NetworkEgress ChartEntries `json:"networkEgress,omitempty"`
  53. ProcessCPU ChartEntries `json:"processCPU,omitempty"`
  54. SystemCPU ChartEntries `json:"systemCPU,omitempty"`
  55. DiskRead ChartEntries `json:"diskRead,omitempty"`
  56. DiskWrite ChartEntries `json:"diskWrite,omitempty"`
  57. }
  58. type LogsMessage struct {
  59. Log []string `json:"log,omitempty"`
  60. }