joseflauzino commented on a change in pull request #5984: URL: https://github.com/apache/cloudstack/pull/5984#discussion_r807195410
########## File path: engine/schema/src/main/java/com/cloud/vm/VmStatsVO.java ########## @@ -0,0 +1,80 @@ +// 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 com.cloud.vm; + +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@Table(name = "vm_stats") +public class VmStatsVO { Review comment: @ravening I think that instead of replicating the `instance_name` field in different tables, we can just use JOIN. To get stats from a specific `instance_name` we can use something like: ```SQL SELECT vm.instance_name, vs.timestamp, vs.vm_stats_data FROM vm_stats vs JOIN vm_instance vm ON vs.vm_id=vm.id WHERE vm.instance_name = ? ``` Therefore, I do not see the reason to add the `instance_name` in the `vm_stats` table. -- 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]
