@@ -66,20 +66,20 @@ public PushGateway(String address) {
6666 }
6767
6868 /**
69- * Pushes all metrics in a registry, replacing all those with the same job as the grouping key.
69+ * Pushes all metrics in a registry, replacing all those with the same job and no grouping key.
7070 * <p>
71- * This uses the POST HTTP method.
71+ * This uses the PUT HTTP method.
7272 */
7373 public void push (CollectorRegistry registry , String job ) throws IOException {
74- doRequest (registry , job , null , "POST " );
74+ doRequest (registry , job , null , "PUT " );
7575 }
7676
7777 /**
7878 * Pushes all metrics in a Collector, replacing all those with the same job and no grouping key.
7979 * <p>
8080 * This is useful for pushing a single Gauge.
8181 * <p>
82- * This uses the POST HTTP method.
82+ * This uses the PUT HTTP method.
8383 */
8484 public void push (Collector collector , String job ) throws IOException {
8585 CollectorRegistry registry = new CollectorRegistry ();
@@ -88,22 +88,20 @@ public void push(Collector collector, String job) throws IOException {
8888 }
8989
9090 /**
91- * Pushes all metrics in a Collector , replacing all those with the same job and grouping key.
91+ * Pushes all metrics in a registry , replacing all those with the same job and grouping key.
9292 * <p>
93- * This is useful for pushing a single Gauge.
94- * <p>
95- * This uses the POST HTTP method.
93+ * This uses the PUT HTTP method.
9694 */
9795 public void push (CollectorRegistry registry , String job , Map <String , String > groupingKey ) throws IOException {
98- doRequest (registry , job , groupingKey , "POST " );
96+ doRequest (registry , job , groupingKey , "PUT " );
9997 }
10098
10199 /**
102100 * Pushes all metrics in a Collector, replacing all those with the same job and grouping key.
103101 * <p>
104102 * This is useful for pushing a single Gauge.
105103 * <p>
106- * This uses the POST HTTP method.
104+ * This uses the PUT HTTP method.
107105 */
108106 public void push (Collector collector , String job , Map <String , String > groupingKey ) throws IOException {
109107 CollectorRegistry registry = new CollectorRegistry ();
@@ -114,18 +112,18 @@ public void push(Collector collector, String job, Map<String, String> groupingKe
114112 /**
115113 * Pushes all metrics in a registry, replacing only previously pushed metrics of the same name and job and no grouping key.
116114 * <p>
117- * This uses the PUT HTTP method.
115+ * This uses the POST HTTP method.
118116 */
119117 public void pushAdd (CollectorRegistry registry , String job ) throws IOException {
120- doRequest (registry , job , null , "PUT " );
118+ doRequest (registry , job , null , "POST " );
121119 }
122120
123121 /**
124122 * Pushes all metrics in a Collector, replacing only previously pushed metrics of the same name and job and no grouping key.
125123 * <p>
126124 * This is useful for pushing a single Gauge.
127125 * <p>
128- * This uses the PUT HTTP method.
126+ * This uses the POST HTTP method.
129127 */
130128 public void pushAdd (Collector collector , String job ) throws IOException {
131129 CollectorRegistry registry = new CollectorRegistry ();
@@ -134,22 +132,20 @@ public void pushAdd(Collector collector, String job) throws IOException {
134132 }
135133
136134 /**
137- * Pushes all metrics in a Collector, replacing only previously pushed metrics of the same name, job and grouping key.
138- * <p>
139- * This is useful for pushing a single Gauge.
135+ * Pushes all metrics in a registry, replacing only previously pushed metrics of the same name, job and grouping key.
140136 * <p>
141- * This uses the PUT HTTP method.
137+ * This uses the POST HTTP method.
142138 */
143139 public void pushAdd (CollectorRegistry registry , String job , Map <String , String > groupingKey ) throws IOException {
144- doRequest (registry , job , groupingKey , "PUT " );
140+ doRequest (registry , job , groupingKey , "POST " );
145141 }
146142
147143 /**
148144 * Pushes all metrics in a Collector, replacing only previously pushed metrics of the same name, job and grouping key.
149145 * <p>
150146 * This is useful for pushing a single Gauge.
151147 * <p>
152- * This uses the PUT HTTP method.
148+ * This uses the POST HTTP method.
153149 */
154150 public void pushAdd (Collector collector , String job , Map <String , String > groupingKey ) throws IOException {
155151 CollectorRegistry registry = new CollectorRegistry ();
@@ -182,7 +178,7 @@ public void delete(String job, Map<String, String> groupingKey) throws IOExcepti
182178 /**
183179 * Pushes all metrics in a registry, replacing all those with the same job and instance.
184180 * <p>
185- * This uses the POST HTTP method.
181+ * This uses the PUT HTTP method.
186182 * @deprecated use {@link #push(CollectorRegistry, String, Map)}
187183 */
188184 @ Deprecated
@@ -195,7 +191,7 @@ public void push(CollectorRegistry registry, String job, String instance) throws
195191 * <p>
196192 * This is useful for pushing a single Gauge.
197193 * <p>
198- * This uses the POST HTTP method.
194+ * This uses the PUT HTTP method.
199195 * @deprecated use {@link #push(Collector, String, Map)}
200196 */
201197 @ Deprecated
@@ -206,7 +202,7 @@ public void push(Collector collector, String job, String instance) throws IOExce
206202 /**
207203 * Pushes all metrics in a registry, replacing only previously pushed metrics of the same name.
208204 * <p>
209- * This uses the PUT HTTP method.
205+ * This uses the POST HTTP method.
210206 * @deprecated use {@link #pushAdd(CollectorRegistry, String, Map)}
211207 */
212208 @ Deprecated
@@ -219,7 +215,7 @@ public void pushAdd(CollectorRegistry registry, String job, String instance) thr
219215 * <p>
220216 * This is useful for pushing a single Gauge.
221217 * <p>
222- * This uses the PUT HTTP method.
218+ * This uses the POST HTTP method.
223219 * @deprecated use {@link #pushAdd(Collector, String, Map)}
224220 */
225221 @ Deprecated
0 commit comments