ppapou commented on a change in pull request #1393:
URL: https://github.com/apache/incubator-datalab/pull/1393#discussion_r789697202



##########
File path: 
services/self-service/src/main/java/com/epam/datalab/backendapi/service/impl/BillingServiceImpl.java
##########
@@ -340,6 +341,21 @@ private void appendStatuses(BillingReportLine br) {
         }
     }
 
+    private void appendShapes(BillingReportLine br) {
+        BillingResourceType resourceType = br.getResourceType();
+        if (BillingResourceType.COMPUTATIONAL == resourceType) {
+            String shape = "Master: 1 x %s Slave: %s x %s";
+            exploratoryService.getUserInstance(br.getUser(), br.getProject(), 
br.getExploratoryName(), true)
+                    .flatMap(ui -> ui.getResources()
+                            .stream()
+                            .filter(cr -> 
cr.getComputationalName().equals(br.getResourceName()))
+                            .findAny())
+                    .ifPresent(cr -> br.setShape(
+                            String.format(shape, cr.getMasterNodeShape(), 
cr.getTotalInstanceCount() - 1, cr.getSlaveNodeShape())

Review comment:
       May I clarify, why the instances count is decreased by 1?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to