message.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 GeneralMessage struct {
  28. Version string `json:"version,omitempty"`
  29. Commit string `json:"commit,omitempty"`
  30. }
  31. type HomeMessage struct {
  32. ActiveMemory ChartEntries `json:"activeMemory,omitempty"`
  33. VirtualMemory ChartEntries `json:"virtualMemory,omitempty"`
  34. NetworkIngress ChartEntries `json:"networkIngress,omitempty"`
  35. NetworkEgress ChartEntries `json:"networkEgress,omitempty"`
  36. ProcessCPU ChartEntries `json:"processCPU,omitempty"`
  37. SystemCPU ChartEntries `json:"systemCPU,omitempty"`
  38. DiskRead ChartEntries `json:"diskRead,omitempty"`
  39. DiskWrite ChartEntries `json:"diskWrite,omitempty"`
  40. }
  41. type ChartEntries []*ChartEntry
  42. type ChartEntry struct {
  43. Time time.Time `json:"time,omitempty"`
  44. Value float64 `json:"value,omitempty"`
  45. }
  46. type ChainMessage struct {
  47. /* TODO (kurkomisi) */
  48. }
  49. type TxPoolMessage struct {
  50. /* TODO (kurkomisi) */
  51. }
  52. type NetworkMessage struct {
  53. /* TODO (kurkomisi) */
  54. }
  55. type SystemMessage struct {
  56. /* TODO (kurkomisi) */
  57. }
  58. type LogsMessage struct {
  59. Log []string `json:"log,omitempty"`
  60. }