mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 08:29:36 +01:00
feat(production): Rückwärts-Tracing für Herkunftsnachweis (US-P19)
Spiegelt die bestehende traceForward-Architektur mit invertierter SQL-JOIN-Richtung, um von einer Endprodukt-Charge alle verwendeten Rohstoff-Chargen zu ermitteln (Herkunftsnachweis).
This commit is contained in:
parent
252f48d52b
commit
6996a301f9
15 changed files with 632 additions and 6 deletions
|
|
@ -89,6 +89,34 @@ public final class ProductionScenario {
|
|||
);
|
||||
}
|
||||
|
||||
// ---- Tracing ----
|
||||
|
||||
public static ChainBuilder traceForward() {
|
||||
return exec(session -> {
|
||||
var ids = LoadTestDataSeeder.batchIds();
|
||||
String id = ids.get(ThreadLocalRandom.current().nextInt(ids.size()));
|
||||
return session.set("traceBatchId", id);
|
||||
}).exec(
|
||||
http("Charge vorwärts tracen")
|
||||
.get("/api/production/batches/#{traceBatchId}/trace-forward")
|
||||
.header("Authorization", "Bearer #{accessToken}")
|
||||
.check(status().in(200, 404))
|
||||
);
|
||||
}
|
||||
|
||||
public static ChainBuilder traceBackward() {
|
||||
return exec(session -> {
|
||||
var ids = LoadTestDataSeeder.batchIds();
|
||||
String id = ids.get(ThreadLocalRandom.current().nextInt(ids.size()));
|
||||
return session.set("traceBatchId", id);
|
||||
}).exec(
|
||||
http("Charge rückwärts tracen")
|
||||
.get("/api/production/batches/#{traceBatchId}/trace-backward")
|
||||
.header("Authorization", "Bearer #{accessToken}")
|
||||
.check(status().in(200, 404))
|
||||
);
|
||||
}
|
||||
|
||||
// ---- Produktionsaufträge ----
|
||||
|
||||
public static ChainBuilder createProductionOrder() {
|
||||
|
|
@ -259,6 +287,11 @@ public final class ProductionScenario {
|
|||
.pause(1, 2)
|
||||
.exec(listProductionOrdersByStatus())
|
||||
.pause(1, 2)
|
||||
// Tracing-Szenarien
|
||||
.exec(traceForward())
|
||||
.pause(1, 2)
|
||||
.exec(traceBackward())
|
||||
.pause(1, 2)
|
||||
// Nochmal Chargen-Liste prüfen
|
||||
.exec(listBatches());
|
||||
}
|
||||
|
|
@ -271,11 +304,13 @@ public final class ProductionScenario {
|
|||
.exec(AuthenticationScenario.login("admin", "admin123"))
|
||||
.repeat(15).on(
|
||||
randomSwitch().on(
|
||||
percent(30.0).then(listRecipes()),
|
||||
percent(20.0).then(getRandomRecipe()),
|
||||
percent(20.0).then(listBatches()),
|
||||
percent(15.0).then(listProductionOrders()),
|
||||
percent(15.0).then(listProductionOrdersByStatus())
|
||||
percent(25.0).then(listRecipes()),
|
||||
percent(15.0).then(getRandomRecipe()),
|
||||
percent(15.0).then(listBatches()),
|
||||
percent(10.0).then(listProductionOrders()),
|
||||
percent(10.0).then(listProductionOrdersByStatus()),
|
||||
percent(12.5).then(traceForward()),
|
||||
percent(12.5).then(traceBackward())
|
||||
).pause(1, 3)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,6 +127,10 @@ public class FullWorkloadSimulation extends Simulation {
|
|||
details("Inventur starten").responseTime().mean().lt(50),
|
||||
details("Ist-Menge erfassen").responseTime().mean().lt(50),
|
||||
|
||||
// Tracing: BFS-Traversierung, mean < 50ms
|
||||
details("Charge vorwärts tracen").responseTime().mean().lt(50),
|
||||
details("Charge rückwärts tracen").responseTime().mean().lt(50),
|
||||
|
||||
// Produktionsaufträge-Listen: mean < 35ms
|
||||
details("Produktionsaufträge auflisten").responseTime().mean().lt(35),
|
||||
details("Produktionsaufträge nach Status").responseTime().mean().lt(35)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue