public List<ImmutableMap<String, SampleFamily>> convertSampleFamily(TelegrafData telegrafData) {
        List<Sample> allSamples = new ArrayList<>();

        List<TelegrafDatum> metrics = telegrafData.getMetrics();
        for (TelegrafDatum m : metrics) {
            List<Sample> samples = convertTelegraf(m);
            allSamples.addAll(samples);
        }

        List<ImmutableMap<String, SampleFamily>> res = new ArrayList<>();

        // Grouping all samples by timestamp name
        Map<Long, List<Sample>> sampleFamilyByTime = allSamples.stream()
                .collect(Collectors.groupingBy(Sample::getTimestamp));

        // Grouping all samples with the same timestamp by name
        for (List<Sample> s : sampleFamilyByTime.values()) {
            ImmutableMap.Builder<String, SampleFamily> builder = ImmutableMap.builder();
            Map<String, List<Sample>> sampleFamilyByName = s.stream()
                    .collect(Collectors.groupingBy(Sample::getName));
            sampleFamilyByName.forEach((k, v) ->
                    builder.put(k, SampleFamilyBuilder.newBuilder(v.toArray(new Sample[0])).build()));
            res.add(builder.build());
        }

        return res;
    }
Convert the TelegrafData object to meter {@link Sample}
oap-server/server-receiver-plugin/skywalking-telegraf-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/telegraf/provider/handler/TelegrafServiceHandler.java