| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | package openldap |
| 4 | |
| 5 | import ( |
| 6 | "github.com/netdata/netdata/go/plugins/plugin/framework/collectorapi" |
| 7 | ) |
| 8 | |
| 9 | const ( |
| 10 | prioCurrentConnections = collectorapi.Priority + iota |
| 11 | prioTotalConnections |
| 12 | prioBytesSent |
| 13 | prioEntries |
| 14 | prioReferrals |
| 15 | prioOperations |
| 16 | prioOperationsByType |
| 17 | prioWaiters |
| 18 | ) |
| 19 | |
| 20 | var charts = collectorapi.Charts{ |
| 21 | currentConnectionsChart.Copy(), |
| 22 | connectionsChart.Copy(), |
| 23 | |
| 24 | bytesSentChart.Copy(), |
| 25 | referralsSentChart.Copy(), |
| 26 | entriesSentChart.Copy(), |
| 27 | |
| 28 | operationsChart.Copy(), |
| 29 | operationsByTypeChart.Copy(), |
| 30 | |
| 31 | waitersChart.Copy(), |
| 32 | } |
| 33 | |
| 34 | var ( |
| 35 | currentConnectionsChart = collectorapi.Chart{ |
| 36 | ID: "current_connections", |
| 37 | Title: "Current Connections", |
| 38 | Units: "connections", |
| 39 | Fam: "connections", |
| 40 | Ctx: "openldap.current_connections", |
| 41 | Priority: prioCurrentConnections, |
| 42 | Type: collectorapi.Line, |
| 43 | Dims: collectorapi.Dims{ |
| 44 | {ID: "current_connections", Name: "active"}, |
| 45 | }, |
| 46 | } |
| 47 | connectionsChart = collectorapi.Chart{ |
| 48 | ID: "connections", |
| 49 | Title: "Connections", |
| 50 | Units: "connections/s", |
| 51 | Fam: "connections", |
| 52 | Ctx: "openldap.connections", |
| 53 | Priority: prioTotalConnections, |
| 54 | Type: collectorapi.Line, |
| 55 | Dims: collectorapi.Dims{ |
| 56 | {ID: "total_connections", Name: "connections", Algo: collectorapi.Incremental}, |
| 57 | }, |
| 58 | } |
| 59 | |
| 60 | bytesSentChart = collectorapi.Chart{ |
| 61 | ID: "bytes_sent", |
| 62 | Title: "Traffic", |
| 63 | Units: "bytes/s", |
| 64 | Fam: "activity", |
| 65 | Ctx: "openldap.traffic", |
| 66 | Priority: prioBytesSent, |
| 67 | Type: collectorapi.Area, |
| 68 | Dims: collectorapi.Dims{ |
| 69 | {ID: "bytes_sent", Name: "sent", Algo: collectorapi.Incremental}, |
| 70 | }, |
| 71 | } |
| 72 | entriesSentChart = collectorapi.Chart{ |
| 73 | ID: "entries_sent", |
| 74 | Title: "Entries", |
| 75 | Units: "entries/s", |
| 76 | Fam: "activity", |
| 77 | Ctx: "openldap.entries", |
| 78 | Priority: prioEntries, |
| 79 | Type: collectorapi.Line, |
| 80 | Dims: collectorapi.Dims{ |
| 81 | {ID: "entries_sent", Name: "sent", Algo: collectorapi.Incremental}, |
| 82 | }, |
| 83 | } |
| 84 | referralsSentChart = collectorapi.Chart{ |
| 85 | ID: "referrals_sent", |
| 86 | Title: "Referrals", |
| 87 | Units: "referrals/s", |
| 88 | Fam: "activity", |
| 89 | Ctx: "openldap.referrals", |
| 90 | Priority: prioReferrals, |
| 91 | Type: collectorapi.Line, |
| 92 | Dims: collectorapi.Dims{ |
| 93 | {ID: "referrals_sent", Name: "sent", Algo: collectorapi.Incremental}, |
| 94 | }, |
| 95 | } |
| 96 | |
| 97 | operationsChart = collectorapi.Chart{ |
| 98 | ID: "operations", |
| 99 | Title: "Operations", |
| 100 | Units: "operations/s", |
| 101 | Fam: "operations", |
| 102 | Ctx: "openldap.operations", |
| 103 | Priority: prioOperations, |
| 104 | Type: collectorapi.Line, |
| 105 | Dims: collectorapi.Dims{ |
| 106 | {ID: "completed_operations", Name: "completed", Algo: collectorapi.Incremental}, |
| 107 | {ID: "initiated_operations", Name: "initiated", Algo: collectorapi.Incremental}, |
| 108 | }, |
| 109 | } |
| 110 | operationsByTypeChart = collectorapi.Chart{ |
| 111 | ID: "operations_by_type", |
| 112 | Title: "Operations by Type", |
| 113 | Units: "operations/s", |
| 114 | Fam: "operations", |
| 115 | Ctx: "openldap.operations_by_type", |
| 116 | Priority: prioOperationsByType, |
| 117 | Type: collectorapi.Stacked, |
| 118 | Dims: collectorapi.Dims{ |
| 119 | {ID: "completed_bind_operations", Name: "bind", Algo: collectorapi.Incremental}, |
| 120 | {ID: "completed_search_operations", Name: "search", Algo: collectorapi.Incremental}, |
| 121 | {ID: "completed_unbind_operations", Name: "unbind", Algo: collectorapi.Incremental}, |
| 122 | {ID: "completed_add_operations", Name: "add", Algo: collectorapi.Incremental}, |
| 123 | {ID: "completed_delete_operations", Name: "delete", Algo: collectorapi.Incremental}, |
| 124 | {ID: "completed_modify_operations", Name: "modify", Algo: collectorapi.Incremental}, |
| 125 | {ID: "completed_compare_operations", Name: "compare", Algo: collectorapi.Incremental}, |
| 126 | }, |
| 127 | } |
| 128 | waitersChart = collectorapi.Chart{ |
| 129 | ID: "waiters", |
| 130 | Title: "Waiters", |
| 131 | Units: "waiters/s", |
| 132 | Fam: "operations", |
| 133 | Ctx: "openldap.waiters", |
| 134 | Priority: prioWaiters, |
| 135 | Type: collectorapi.Line, |
| 136 | Dims: collectorapi.Dims{ |
| 137 | {ID: "read_waiters", Name: "read", Algo: collectorapi.Incremental}, |
| 138 | {ID: "write_waiters", Name: "write", Algo: collectorapi.Incremental}, |
| 139 | }, |
| 140 | } |
| 141 | ) |