use of com.netflix.config.DynamicProperty in project incubator-servicecomb-java-chassis by apache.
the class InspectorImpl method createPriorityPropertyView.
private PriorityPropertyView createPriorityPropertyView(PriorityProperty<?> priorityProperty) {
PriorityPropertyView view = new PriorityPropertyView();
view.setDynamicProperties(new ArrayList<>());
for (DynamicProperty property : priorityProperty.getProperties()) {
view.getDynamicProperties().add(createDynamicPropertyView(property));
}
view.setDefaultValue(String.valueOf(priorityProperty.getDefaultValue()));
view.setValue(String.valueOf(priorityProperty.getValue()));
return view;
}
use of com.netflix.config.DynamicProperty in project incubator-servicecomb-java-chassis by apache.
the class InspectorImpl method dynamicProperties.
@Path("/dynamicProperties")
@GET
public List<DynamicPropertyView> dynamicProperties() {
List<DynamicPropertyView> views = new ArrayList<>();
for (DynamicProperty property : ConfigUtil.getAllDynamicProperties().values()) {
views.add(createDynamicPropertyView(property));
}
// show more callback first, because maybe there is memory leak problem
// show recently changed second
// and sort by key
views.sort(Comparator.comparing(DynamicPropertyView::getCallbackCount).thenComparing(DynamicPropertyView::getChangedTime).reversed().thenComparing(DynamicPropertyView::getKey));
return views;
}
Aggregations