| 63 | } |
| 64 | |
| 65 | int64_t XmonAgent::_createAlert(XmonAppType appType, bool binnable, Duration quietPeriod, const std::string& message) { |
| 66 | int64_t aid = _alertId.fetch_add(1); |
| 67 | XmonRequest req; |
| 68 | req.appType = appType; |
| 69 | req.msgType = XmonRequestType::CREATE; |
| 70 | req.alertId = aid; |
| 71 | req.binnable = binnable; |
| 72 | req.message = message; |
| 73 | req.quietPeriod = quietPeriod; |
| 74 | req.write(_pipe[1]); |
| 75 | return aid; |
| 76 | } |
| 77 | |
| 78 | XmonAgent::XmonAgent() : _alertId(1) { |
| 79 | if (pipe(_pipe) < 0) { |