How to add an operator to the benchmark list
Introduction
SNAP provides a tool to compute the best settings for a given operator, from SNAP (menu Tools/Options/Performance) or by directly launching the snap-conf-optimiser executable. snap-engine comes with a basic list of compatible operators that can be extended. This page explains how to add an operator to this list.
Content
To add an operator or a list of operator to the list of benchmark operators:
Write a BenchmarkOperatorProvider
Extends the org.esa.snap.smart.configurator.BenchmarkOperatorProvider and implement the getBenchmarkOperatorAliases() method, which gives the list of operator aliases to be added the the benchmarkable operator list.Example for snap-engine operatorspublic class SNAPEngineBenchmarkOperatorProvider extends BenchmarkOperatorProvider { @Override protected List<String> getBenchmarkOperatorAliases() { String[] snapEngineBenchmarkOperatorNames = {"Import-Vector", "Flip", "PassThrough", "Reproject", "WriteRGB", "Convert-Datatype", "Write"}; return Arrays.asList(snapEngineBenchmarkOperatorNames); } }
Declare the BenchmarkOperatorProvider
Create a org.esa.snap.smart.configurator.BenchmarkOperatorProvider file in the resources/META-INF/services folder or your projectExample of Benchmark operator list extension declarationorg.esa.snap.smart.configurator.SNAPEngineBenchmarkOperatorProvider
Production Code Samples
Source code and example of extension can be found in the smart-configurator project:
https://github.com/senbox-org/snap-engine/tree/master/snap-smart-configurator
Further Info
N/A