当前位置: 首页 > news >正文

怎么用wordpress建电商网站做视频网站用什么格式

怎么用wordpress建电商网站,做视频网站用什么格式,网站htm建设,WordPress 主题 美化前言#xff1a; 在日常开发中#xff0c;应用程序的性能是我们需要关注的一个重点问题。当然我们有很多工具来分析程序性能#xff1a;如#xff1a;Zipkin等#xff1b;但这些过于复杂#xff0c;需要单独搭建。 MiniProfiler就是一款简单#xff0c;但功能强大的应用…前言 在日常开发中应用程序的性能是我们需要关注的一个重点问题。当然我们有很多工具来分析程序性能如Zipkin等但这些过于复杂需要单独搭建。 MiniProfiler就是一款简单但功能强大的应用新能分析工具可以帮助我们定位SQL性能问题、响应慢等问题。 本篇文章将介绍MiniProfiler在Asp.Net Core中如何使用 一、MiniProfiler介绍 MiniProfiler是一款针对.NET, Ruby, Go and Node.js的性能分析的轻量级程序。可以对一个页面本身及该页面通过直接引用、Ajax、Iframe形式访问的其它页面进行监控,监控内容包括数据库内容并可以显示数据库访问的SQL支持EF、EF CodeFirst等 。并且以很友好的方式展现在页面上。 MiniProfiler官网http://miniprofiler.com/ MiniProfiler的一个特别有用的功能是它与数据库框架的集成。除了.NET原生的 DbConnection类MiniProfiler还内置了对实体框架Entity Framework以及LINQ to SQL、RavenDb和MongoDB的支持。任何执行的Step都会包括当时查询的次数和所花费的时间。为了检测常见的错误如N1反模式profiler将检测仅有参数值存在差异的多个查询。 二、MiniProfiler用法 1、Nuget包安装 //Mvc Install-Package MiniProfiler.AspNetCore.Mvc //EF分析添加 Install-Package MiniProfiler.EntityFrameworkCore //Reids 缓存添加 Install-Package MiniProfiler.Providers.Redis 2、配置MiniProfiler修改Startup.cs a) 注入MiniProfiler public void ConfigureServices(IServiceCollection services) {// ...其他配置...// 注入MiniProfilerservices.AddMiniProfiler(options {//获取redis配置var redisOptions App.GetOptionsRedisOptions();if (redisOptions.Enable)options.Storage new RedisStorage((ConnectionMultiplexer)App.GetServiceIConnectionMultiplexer ());elseoptions.Storage new MemoryCacheStorage(App.GetServiceIMemoryCache(), TimeSpan.FromMinutes(60));//访问地址路由根目录默认为/mini-profiler-resourcesoptions.RouteBasePath /profiler;//数据缓存时间(options.Storage as MemoryCacheStorage).CacheDuration TimeSpan.FromMinutes(60);//sql格式化设置options.SqlFormatter new StackExchange.Profiling.SqlFormatters.InlineFormatter();//跟踪连接打开关闭options.TrackConnectionOpenClose true;//界面主题颜色方案;默认浅色options.ColorScheme StackExchange.Profiling.ColorScheme.Dark;//.net core 3.0以上对MVC过滤器进行分析options.EnableMvcFilterProfiling true;//对视图进行分析options.EnableMvcViewProfiling true;//控制访问页面授权默认所有人都能访问//options.ResultsAuthorize;//要控制分析哪些请求默认说有请求都分析//options.ShouldProfile;//内部异常处理//options.OnInternalError e MyExceptionLogger(e);})// AddEntityFramework是要监控EntityFrameworkCore生成的SQL.AddEntityFramework(); } b) 启用MiniProfiler   public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMemoryCache cache) {// ...其他配置//该方法必须在app.UseEndpoints以前app.UseMiniProfiler();app.UseEndpoints(routes {// ...}); } c) MVC项目 修改 _ViewImports.cshtml     using StackExchange.Profiling addTagHelper *, MiniProfiler.AspNetCore.Mvc 将MiniProfiler添加到布局文件Shared/_Layout.cshtml中 mini-profiler / d) 运行效果 三、 Swagger UI接入MiniProfiler 使用步骤和前面大体一样 1、下载Swagger页面 请先在Github中下载对应版本的swagger页面https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/src/Swashbuckle.AspNetCore.SwaggerUI/index.html 2、添加到项目中,并设置index.html为内嵌资源 3、修改UseSwaggerUI中间件的配置 app.UseSwaggerUI(c {//Blog.Core.Api 项目命名空间c.SwaggerEndpoint(/swagger/v1/swagger.json, Blog.Core.API V1);c.IndexStream () GetType().GetTypeInfo().Assembly.GetManifestResourceStream(Blog.Core.Api.index.html); }); 4、获取MiniProfiler的html代码片段  /// summary /// 获取html片段 /// /summary /// returns/returns [HttpGet] [Route(GetHtml)] public IActionResult GetHtml() {var html MiniProfiler.Current.RenderIncludes(HttpContext);return Ok(html.Value); } !--1、版本号要与nuget包一致2、id不能为空-- script asyncasync idmini-profiler src/mini-profiler-resources/includes.min.js?v4.2.224563a9e1ab data-version4.2.224563a9e1ab data-path/mini-profiler-resources/ data-current-idf6b88311-015a-44ed-bde0-cdab4c2d0d9b data-idsac204d24-e2df-486e-a135-8167336643b7,f6b88311-015a-44ed-bde0-cdab4c2d0d9b data-positionLeft data-schemeLight data-authorizedtrue data-max-traces15 data-toggle-shortcutAltP data-trivial-milliseconds2.0 data-ignored-duplicate-execute-typesOpen,OpenAsync,Close,CloseAsync/script5、在Swagger的Html中添加获取的MiniProfiler片段 !--1、版本号要与nuget包一致2、id不能为空-- script asyncasync idmini-profiler src/mini-profiler-resources/includes.min.js?v4.2.224563a9e1ab data-version4.2.224563a9e1ab data-path/mini-profiler-resources/ data-current-idf6b88311-015a-44ed-bde0-cdab4c2d0d9b data-idsac204d24-e2df-486e-a135-8167336643b7,f6b88311-015a-44ed-bde0-cdab4c2d0d9b data-positionLeft data-schemeLight data-authorizedtrue data-max-traces15 data-toggle-shortcutAltP data-trivial-milliseconds2.0 data-ignored-duplicate-execute-typesOpen,OpenAsync,Close,CloseAsync/script!-- 加在页面顶部下面代码是swagger 代码可忽略 --!-- HTML for static distribution bundle build -- !DOCTYPE html html langen headmeta charsetUTF-8!--极速模式--meta namerenderer contentwebkit /meta nameforce-rendering contentwebkit /title%(DocumentTitle)/titlelink href./swagger-ui.css relstylesheetmeta nameviewport contentwidthdevice-width, initial-scale1.0link relstylesheet typetext/css href./swagger-ui.csslink relicon typeimage/png href./logo/favicon-32x32.png sizes32x32 /script srcjs/jquery-3.3.1.min.js/scriptstyle.swagger-ui .opblock-summary-control:focus {outline: none}.swagger-ui .topbar .download-url-wrapper {display: flex;flex: 3;margin-bottom: 0px;justify-content: flex-end;}.swagger-ui .auth-container input[typepassword], .swagger-ui .auth-container input[typetext] {min-width: 565px;}html {box-sizing: border-box;overflow-y: scroll;}*,*:before,*:after {box-sizing: inherit;}body {margin: 0;background: #fafafa;}.qqgroup {position: absolute;right: 0px;top: 0px;}.info {float: left;position: relative;width: 100%;}.download-contents {display: none;}/* 滚动槽 */::-webkit-scrollbar {width: 9px;height: 9px;}::-webkit-scrollbar-track {border-radius: 3px;background: rgba(0,0,0,0.06);-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.08);}/* 滚动条滑块 */::-webkit-scrollbar-thumb {border-radius: 3px;background: rgba(0,0,0,0.12);-webkit-box-shadow: inset 0 0 10px rgba(0,0,0,0.2);}/style%(HeadContent) /head body style user-select: text; 6、调用效果 如上图可以查看到所有请求路径及Sql操作耗时那么如果需要监控指定代码块耗时如何实现呢 四、自定义标记 1、添加标记代码 var miniPro MiniProfiler.Current; using (miniPro.Step(Add AuditLog)) {//保存审计日志await _auditLogService.SaveAsync(auditInfo); } 2、取消监控方式   using(MiniProfiler.Current.Ignore()) {//代码 } 3、当然MiniProfiler还有很多其他功能等待解锁如监控ADO.NET执行耗时需要使用ProfileDBConnection 和 ProfileDBCommand对象 总结 1、MiniProfiler使用非常简单  2、功能满足日常中程序性能优化相关问题 其他  MiniProfiler的监控列表地址http://{xxx}/profiler/results-index
http://www.hkea.cn/news/14540136/

相关文章:

  • 公司网站建设需要多少钱用php做网站教程
  • 网站建设罗贤伟网站域名备案证书下载
  • 广州网站建设哪个好梅州新农村建设网站
  • 东莞做网站的公司有哪些石家庄市高新区建设局网站
  • 个人可以做商城网站电子公司网站设计
  • 石家庄网站建设技术支持淘宝客自建手机网站
  • 嘉兴网站制作网络广告策划书案例
  • 成都淮州新城建设投资有限公司网站小小影院 电视剧免费
  • 泉港区住房和城乡规划建设局网站wordpress插件video playe
  • 小题狂做+官方网站王占山将军是什么军衔
  • 网站开发人员需要什么要求gta5买资产网站在建设
  • 对网站建设更新情况的通报我做网站价格
  • 宁波建网站哪家值得信赖酒店网站的规划与建设
  • 如何查看网站的死链接商城版网站建设
  • 湖南响应式网站哪家好南做网站
  • 网站怎么做谷歌推广北京网站设计知名乐云seo
  • 鹰潭门户网站建设费用电商模式有哪几种
  • 网站的建设框架iis网站asp.net部署
  • 做网站下一页400网站推广
  • 网站开发的前后端是什么岳阳公交优化
  • 网站建设规范管理工作站群
  • 临沂手机网站信息推广技术公司电话号码有做二手厨房设备的网站吗
  • 福州网站搜索引擎优化wordpress设计博客
  • 建站平台取名字wordpress 插件哪里
  • cms建站是什么网站建设汇报 安全保障
  • 在哪个网站做失业分解安徽省驻房城乡建设官方网站
  • 银川网站开发公司joomla3.8与wordpress
  • 网站建设86215软件系统网站建设
  • 网站的技术维护一般要做些什么怎样用模块做网站
  • 朝阳网站建设培训新浪邮箱登录入口