@@ -63,19 +63,19 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
6363
6464 pm := commands .GetPackageManager (req .GetInstance ().GetId ())
6565 if pm == nil {
66- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
66+ stats .Incr ("compile" , stats .M (tags )... )
6767 return nil , errors .New ("invalid instance" )
6868 }
6969
7070 logrus .Tracef ("Compile %s for %s started" , req .GetSketchPath (), req .GetFqbn ())
7171 if req .GetSketchPath () == "" {
72- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
72+ stats .Incr ("compile" , stats .M (tags )... )
7373 return nil , fmt .Errorf ("missing sketchPath" )
7474 }
7575 sketchPath := paths .New (req .GetSketchPath ())
7676 sketch , err := sketches .NewSketchFromPath (sketchPath )
7777 if err != nil {
78- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
78+ stats .Incr ("compile" , stats .M (tags )... )
7979 return nil , fmt .Errorf ("opening sketch: %s" , err )
8080 }
8181
@@ -84,12 +84,12 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
8484 fqbnIn = sketch .Metadata .CPU .Fqbn
8585 }
8686 if fqbnIn == "" {
87- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
87+ stats .Incr ("compile" , stats .M (tags )... )
8888 return nil , fmt .Errorf ("no FQBN provided" )
8989 }
9090 fqbn , err := cores .ParseFQBN (fqbnIn )
9191 if err != nil {
92- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
92+ stats .Incr ("compile" , stats .M (tags )... )
9393 return nil , fmt .Errorf ("incorrect FQBN: %s" , err )
9494 }
9595
@@ -103,7 +103,7 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
103103 // "\"%[1]s:%[2]s\" platform is not installed, please install it by running \""+
104104 // version.GetAppName()+" core install %[1]s:%[2]s\".", fqbn.Package, fqbn.PlatformArch)
105105 // feedback.Error(errorMessage)
106- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
106+ stats .Incr ("compile" , stats .M (tags )... )
107107 return nil , fmt .Errorf ("platform not installed" )
108108 }
109109
@@ -123,7 +123,7 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
123123 builderCtx .BuildPath = paths .New (req .GetBuildPath ())
124124 err = builderCtx .BuildPath .MkdirAll ()
125125 if err != nil {
126- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
126+ stats .Incr ("compile" , stats .M (tags )... )
127127 return nil , fmt .Errorf ("cannot create build directory: %s" , err )
128128 }
129129 }
@@ -149,7 +149,7 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
149149 builderCtx .BuildCachePath = paths .New (req .GetBuildCachePath ())
150150 err = builderCtx .BuildCachePath .MkdirAll ()
151151 if err != nil {
152- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
152+ stats .Incr ("compile" , stats .M (tags )... )
153153 return nil , fmt .Errorf ("cannot create build cache directory: %s" , err )
154154 }
155155 }
@@ -183,17 +183,17 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
183183 // if --preprocess or --show-properties were passed, we can stop here
184184 if req .GetShowProperties () {
185185 tags ["success" ] = "true"
186- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
186+ stats .Incr ("compile" , stats .M (tags )... )
187187 return & rpc.CompileResp {}, builder .RunParseHardwareAndDumpBuildProperties (builderCtx )
188188 } else if req .GetPreprocess () {
189189 tags ["success" ] = "true"
190- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
190+ stats .Incr ("compile" , stats .M (tags )... )
191191 return & rpc.CompileResp {}, builder .RunPreprocess (builderCtx )
192192 }
193193
194194 // if it's a regular build, go on...
195195 if err := builder .RunBuilder (builderCtx ); err != nil {
196- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
196+ stats .Incr ("compile" , stats .M (tags )... )
197197 return nil , err
198198 }
199199
@@ -229,7 +229,7 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
229229 // Copy "sketch.ino.*.hex" / "sketch.ino.*.bin" artifacts to sketch directory
230230 srcDir , err := outputPath .Parent ().ReadDir () // read "/build/path/*"
231231 if err != nil {
232- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
232+ stats .Incr ("compile" , stats .M (tags )... )
233233 return nil , fmt .Errorf ("reading build directory: %s" , err )
234234 }
235235 srcDir .FilterPrefix (base + "." )
@@ -240,7 +240,7 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
240240 dstOutput := exportPath .Join (exportFile + srcFilename )
241241 logrus .WithField ("from" , srcOutput ).WithField ("to" , dstOutput ).Debug ("copying sketch build output" )
242242 if err = srcOutput .CopyTo (dstOutput ); err != nil {
243- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
243+ stats .Incr ("compile" , stats .M (tags )... )
244244 return nil , fmt .Errorf ("copying output file: %s" , err )
245245 }
246246 }
@@ -251,13 +251,13 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
251251 dstElf := exportPath .Join (exportFile + ".elf" )
252252 logrus .WithField ("from" , srcElf ).WithField ("to" , dstElf ).Debug ("copying sketch build output" )
253253 if err = srcElf .CopyTo (dstElf ); err != nil {
254- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
254+ stats .Incr ("compile" , stats .M (tags )... )
255255 return nil , fmt .Errorf ("copying elf file: %s" , err )
256256 }
257257 }
258258
259259 logrus .Tracef ("Compile %s for %s successful" , sketch .Name , fqbnIn )
260260 tags ["success" ] = "true"
261- telemetry . Engine .Incr ("compile" , stats .M (tags )... )
261+ stats .Incr ("compile" , stats .M (tags )... )
262262 return & rpc.CompileResp {}, nil
263263}
0 commit comments