Signed-off-by: Alexandre Terrasa <alexadre@moz-code.org>
module metrics
import metrics_base
module metrics
import metrics_base
+import refinement_metrics
import static_types_metrics
import nullables_metrics
import self_metrics
import static_types_metrics
import nullables_metrics
import self_metrics
import generate_hierarchies
import rta_metrics
import model_hyperdoc
import generate_hierarchies
import rta_metrics
import model_hyperdoc
+ # --refinement
+ var opt_refinement = new OptionBool("Compute metrics about refinement usage", "--refinement")
# --self
var opt_self = new OptionBool("Compute metrics about the usage of explicit and implicit self", "--self")
# --nullables
# --self
var opt_self = new OptionBool("Compute metrics about the usage of explicit and implicit self", "--self")
# --nullables
+ self.option_context.add_option(opt_refinement)
self.option_context.add_option(opt_self)
self.option_context.add_option(opt_nullables)
self.option_context.add_option(opt_static_types)
self.option_context.add_option(opt_self)
self.option_context.add_option(opt_nullables)
self.option_context.add_option(opt_static_types)
# See the License for the specific language governing permissions and
# limitations under the License.
# See the License for the specific language governing permissions and
# limitations under the License.
-# General statistics on a model
-module model_stats
+# Collect metrics about refinement usage
+module refinement_metrics
import model
private import metrics_base
import model
private import metrics_base
-# Print general statistics on a model
-fun compute_statistics(model: Model)
+# Print refinement usage metrics
+fun compute_refinement_metrics(model: Model)
- print "--- Statistics of the model ---"
+ print "--- Metrics of refinement usage ---"
var nbmod = model.mmodules.length
print "Number of modules: {nbmod}"
var nbmod = model.mmodules.length
print "Number of modules: {nbmod}"
# Now, we just have to play with the model!
print "*** STATS ***"
# Now, we just have to play with the model!
print "*** STATS ***"
-print ""
-compute_statistics(model)
+# Refinement usage metrics
+if toolcontext.opt_refinement.value then
+ print ""
+ compute_refinement_metrics(model)
+end
# Self usage metrics
if toolcontext.opt_self.value then
# Self usage metrics
if toolcontext.opt_self.value then