for (int entryIndex = 0; entryIndex < numEntries; entryIndex++) {
DataEntry entry = new DataEntry();
// Add all dimensions.
for (int dimensionIndex = 0; dimensionIndex < dimensions.length; dimensionIndex++) {
Dimension dimension = new Dimension();
dimension.setValue(dimensions[dimensionIndex][entryIndex]);
if (dimensionNames != null) {
dimension.setName(dimensionNames[dimensionIndex]);
}
entry.addDimension(dimension);
}
// Add all metrics.
for (int metricIndex = 0; metricIndex < metrics.length; metricIndex++) {