metron-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From merrimanr <...@git.apache.org>
Subject [GitHub] metron pull request #607: METRON-982 add new rest api for storm supervisor s...
Date Thu, 27 Jul 2017 18:44:34 GMT
Github user merrimanr commented on a diff in the pull request:

    https://github.com/apache/metron/pull/607#discussion_r129926344
  
    --- Diff: metron-interface/metron-rest-client/src/main/java/org/apache/metron/rest/model/SupervisorStatus.java
---
    @@ -0,0 +1,127 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.metron.rest.model;
    +
    +public class SupervisorStatus {
    +  /*
    +    /api/v1/supervisor/summary (GET)
    +    returns all supervisors summary
    +
    +    Response Fields:
    +
    +    Field	Value	Description
    +    id	String	Supervisor's id
    +    host	String	Supervisor's host name
    +    upTime	String	Shows how long the supervisor is running
    +    slotsTotal	Integer	Total number of available worker slots for this supervisor
    +    slotsUsed	Integer	Number of worker slots used on this supervisor
    +    Sample Response:
    +    json { "supervisors": [ { "id": "0b879808-2a26-442b-8f7d-23101e0c3696", "host": "10.11.1.7",
"upTime": "5m 58s", "slotsTotal": 4, "slotsUsed": 3 } ] }
    +
    +  */
    +  private String id;
    +  private String host;
    +  private String upTime;
    --- End diff --
    
    When I tested this in full dev with Swagger, the upTime field in the response was null.
 Here's an example response when I hit http://node1:8744/api/v1/supervisor/summary:
    ```
    {"supervisors":[{"totalMem":3072.0,"host":"node1","id":"70bd7170-160f-4215-8f18-d9088993fb47","uptime":"47m
20s","totalCpu":400.0,"usedCpu":0.0,"logLink":"http:\/\/node1:8000\/daemonlog?file=supervisor.log","usedMem":3328.0,"slotsUsed":4,"version":"1.0.1.2.5.6.0-40","slotsTotal":4,"uptimeSeconds":2840}],"schedulerDisplayResource":false,"logviewerPort":8000}
    ```
    Notice the field is actually "uptime".  I changed the upTime variable name and getter/setting
methods and that fixed it.  
    
    The StormControllerIntegrationTest uses a mock Storm REST API so you're not going to catch
it there.  You would only catch this by hitting a real Storm REST API.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message