public ProfileTaskCommand newProfileTaskCommand(ProfileTask task) {
        final String serialNumber = UUID.randomUUID().toString();
        return new ProfileTaskCommand(
            serialNumber, task.getId(), task.getEndpointName(), task.getDuration(), task.getMinDurationThreshold(), task
            .getDumpPeriod(), task.getMaxSamplingCount(), task.getStartTime(), task.getCreateTime());
    }
CommandService represents the command creation factory. All commands for downstream agents should be created here.
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/command/CommandService.java