#58-add new TS classes

This commit is contained in:
BarminaA 2022-06-14 16:19:41 +04:00
parent 9a38056a94
commit 5426253b39
15 changed files with 316 additions and 34 deletions

View File

@ -1,28 +1,22 @@
package ru.ulstu.extractor.ts; package ru.ulstu.extractor.ts;
import ru.ulstu.extractor.model.TimeSeriesValue;
import ru.ulstu.extractor.service.TimeSeriesService;
import java.util.List;
public abstract class AbstractTSExtractor { public abstract class AbstractTSExtractor {
private String name;
private int value;
public abstract void getAbstractTSName(); public abstract String getTSName();
public abstract void addPoint(int value); public abstract TimeSeriesService getTimeSeriesService();
public abstract void addTS(String name, int value); public void addPoint(int value) {
public String getName() {
return name;
} }
public void setName(String name) { public void addTS(List<TimeSeriesValue> values) {
this.name = name; getTimeSeriesService().findOrCreate(getTSName());
} }
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
} }

View File

@ -5,30 +5,19 @@ import ru.ulstu.extractor.service.TimeSeriesService;
@Component @Component
public class AuthorTS extends AbstractTSExtractor { public class AuthorTS extends AbstractTSExtractor {
private static String name = "AuthorTimeSeries"; private final TimeSeriesService timeSeriesService;
private static TimeSeriesService timeSeriesService;
public static void setTimeSeriesService(TimeSeriesService timeSeriesService) { public AuthorTS(TimeSeriesService timeSeriesService) {
AuthorTS.timeSeriesService = timeSeriesService; this.timeSeriesService = timeSeriesService;
} }
@Override @Override
public void getAbstractTSName() { public String getTSName() {
timeSeriesService.findOrCreate(name); return "Количество Авторов";
} }
@Override @Override
public void addPoint(int value) { public TimeSeriesService getTimeSeriesService() {
return timeSeriesService;
}
@Override
public void addTS(String name, int value) {
}
@Override
public String getName() {
return name;
} }
} }

View File

@ -0,0 +1,23 @@
package ru.ulstu.extractor.ts;
import org.springframework.stereotype.Component;
import ru.ulstu.extractor.service.TimeSeriesService;
@Component
public class AuthorsCommentTS extends AbstractTSExtractor {
private final TimeSeriesService timeSeriesService;
public AuthorsCommentTS(TimeSeriesService timeSeriesService) {
this.timeSeriesService = timeSeriesService;
}
@Override
public String getTSName() {
return "Количество коммитов авторов";
}
@Override
public TimeSeriesService getTimeSeriesService() {
return timeSeriesService;
}
}

View File

@ -0,0 +1,23 @@
package ru.ulstu.extractor.ts;
import org.springframework.stereotype.Component;
import ru.ulstu.extractor.service.TimeSeriesService;
@Component
public class AuthorsCompletedIssueTS extends AbstractTSExtractor {
private final TimeSeriesService timeSeriesService;
public AuthorsCompletedIssueTS(TimeSeriesService timeSeriesService) {
this.timeSeriesService = timeSeriesService;
}
@Override
public String getTSName() {
return "Количество выполненных issues авторов";
}
@Override
public TimeSeriesService getTimeSeriesService() {
return timeSeriesService;
}
}

View File

@ -0,0 +1,23 @@
package ru.ulstu.extractor.ts;
import org.springframework.stereotype.Component;
import ru.ulstu.extractor.service.TimeSeriesService;
@Component
public class AuthorsIssueTS extends AbstractTSExtractor {
private final TimeSeriesService timeSeriesService;
public AuthorsIssueTS(TimeSeriesService timeSeriesService) {
this.timeSeriesService = timeSeriesService;
}
@Override
public String getTSName() {
return "Количество issues авторов";
}
@Override
public TimeSeriesService getTimeSeriesService() {
return timeSeriesService;
}
}

View File

@ -0,0 +1,23 @@
package ru.ulstu.extractor.ts;
import org.springframework.stereotype.Component;
import ru.ulstu.extractor.service.TimeSeriesService;
@Component
public class BranchTS extends AbstractTSExtractor {
private final TimeSeriesService timeSeriesService;
public BranchTS(TimeSeriesService timeSeriesService) {
this.timeSeriesService = timeSeriesService;
}
@Override
public String getTSName() {
return "Количество веток";
}
@Override
public TimeSeriesService getTimeSeriesService() {
return timeSeriesService;
}
}

View File

@ -0,0 +1,23 @@
package ru.ulstu.extractor.ts;
import org.springframework.stereotype.Component;
import ru.ulstu.extractor.service.TimeSeriesService;
@Component
public class ClassTS extends AbstractTSExtractor {
private final TimeSeriesService timeSeriesService;
public ClassTS(TimeSeriesService timeSeriesService) {
this.timeSeriesService = timeSeriesService;
}
@Override
public String getTSName() {
return "Количество классов";
}
@Override
public TimeSeriesService getTimeSeriesService() {
return timeSeriesService;
}
}

View File

@ -0,0 +1,23 @@
package ru.ulstu.extractor.ts;
import org.springframework.stereotype.Component;
import ru.ulstu.extractor.service.TimeSeriesService;
@Component
public class CommitsTS extends AbstractTSExtractor {
private final TimeSeriesService timeSeriesService;
public CommitsTS(TimeSeriesService timeSeriesService) {
this.timeSeriesService = timeSeriesService;
}
@Override
public String getTSName() {
return "Количество коммитов во времени";
}
@Override
public TimeSeriesService getTimeSeriesService() {
return timeSeriesService;
}
}

View File

@ -0,0 +1,23 @@
package ru.ulstu.extractor.ts;
import org.springframework.stereotype.Component;
import ru.ulstu.extractor.service.TimeSeriesService;
@Component
public class DependenceTS extends AbstractTSExtractor {
private final TimeSeriesService timeSeriesService;
public DependenceTS(TimeSeriesService timeSeriesService) {
this.timeSeriesService = timeSeriesService;
}
@Override
public String getTSName() {
return "Количество зависимостей";
}
@Override
public TimeSeriesService getTimeSeriesService() {
return timeSeriesService;
}
}

View File

@ -0,0 +1,23 @@
package ru.ulstu.extractor.ts;
import org.springframework.stereotype.Component;
import ru.ulstu.extractor.service.TimeSeriesService;
@Component
public class EntityTS extends AbstractTSExtractor {
private final TimeSeriesService timeSeriesService;
public EntityTS(TimeSeriesService timeSeriesService) {
this.timeSeriesService = timeSeriesService;
}
@Override
public String getTSName() {
return "Количество сущностей";
}
@Override
public TimeSeriesService getTimeSeriesService() {
return timeSeriesService;
}
}

View File

@ -0,0 +1,23 @@
package ru.ulstu.extractor.ts;
import org.springframework.stereotype.Component;
import ru.ulstu.extractor.service.TimeSeriesService;
@Component
public class FileTS extends AbstractTSExtractor {
private final TimeSeriesService timeSeriesService;
public FileTS(TimeSeriesService timeSeriesService) {
this.timeSeriesService = timeSeriesService;
}
@Override
public String getTSName() {
return "Количество файлов";
}
@Override
public TimeSeriesService getTimeSeriesService() {
return timeSeriesService;
}
}

View File

@ -0,0 +1,23 @@
package ru.ulstu.extractor.ts;
import org.springframework.stereotype.Component;
import ru.ulstu.extractor.service.TimeSeriesService;
@Component
public class InterfaceTS extends AbstractTSExtractor {
private final TimeSeriesService timeSeriesService;
public InterfaceTS(TimeSeriesService timeSeriesService) {
this.timeSeriesService = timeSeriesService;
}
@Override
public String getTSName() {
return "Количество интерфейсов";
}
@Override
public TimeSeriesService getTimeSeriesService() {
return timeSeriesService;
}
}

View File

@ -0,0 +1,23 @@
package ru.ulstu.extractor.ts;
import org.springframework.stereotype.Component;
import ru.ulstu.extractor.service.TimeSeriesService;
@Component
public class IssuesTS extends AbstractTSExtractor {
private final TimeSeriesService timeSeriesService;
public IssuesTS(TimeSeriesService timeSeriesService) {
this.timeSeriesService = timeSeriesService;
}
@Override
public String getTSName() {
return "Количество issues созданных во времени";
}
@Override
public TimeSeriesService getTimeSeriesService() {
return null;
}
}

View File

@ -0,0 +1,23 @@
package ru.ulstu.extractor.ts;
import org.springframework.stereotype.Component;
import ru.ulstu.extractor.service.TimeSeriesService;
@Component
public class ProcessTS extends AbstractTSExtractor {
private final TimeSeriesService timeSeriesService;
public ProcessTS(TimeSeriesService timeSeriesService) {
this.timeSeriesService = timeSeriesService;
}
@Override
public String getTSName() {
return "Количество процессов";
}
@Override
public TimeSeriesService getTimeSeriesService() {
return timeSeriesService;
}
}

View File

@ -0,0 +1,23 @@
package ru.ulstu.extractor.ts;
import org.springframework.stereotype.Component;
import ru.ulstu.extractor.service.TimeSeriesService;
@Component
public class StarTS extends AbstractTSExtractor {
private final TimeSeriesService timeSeriesService;
public StarTS(TimeSeriesService timeSeriesService) {
this.timeSeriesService = timeSeriesService;
}
@Override
public String getTSName() {
return "Количество звезд";
}
@Override
public TimeSeriesService getTimeSeriesService() {
return timeSeriesService;
}
}